Help using Base SAS procedures

Merge issue / convert number to time8 format

Accepted Solution Solved
Reply
Regular Contributor
Posts: 240
Accepted Solution

Merge issue / convert number to time8 format

I      Have two tables that I need to merge 

 

 

data all;

Merge table1  table2;

by machine;

incomplete merge comes in only 3   Of 1k...

tablet1  time   Column is format as number...I     Need.  To convert to time8

data    Table2;

set table2;

format ttime time8.;

run;

 

the col comes back blank

 

 


Accepted Solutions
Solution
‎12-13-2015 04:52 PM
Super User
Posts: 19,770

Re: Merge issue / convert number to time8 format

1. Figure out what it is, run a proc contents to see the variable type and format.
2. If it's a character, use input with the format to read it in as a different format (input(var, time8))

View solution in original post


All Replies
Super User
Posts: 19,770

Re: Merge issue / convert number to time8 format

Please clarify your question.
Regular Contributor
Posts: 240

Re: Merge issue / convert number to time8 format

How do I change the format on  my time col to time ? I currently have it as a number in the description section     The data looks like this 12:23:45 ... When I use the data step to change the format it comes back blank the col I wonder if it's even a number maybe it's a character?  How do I convert character to number with a time8 format ? 

Solution
‎12-13-2015 04:52 PM
Super User
Posts: 19,770

Re: Merge issue / convert number to time8 format

1. Figure out what it is, run a proc contents to see the variable type and format.
2. If it's a character, use input with the format to read it in as a different format (input(var, time8))
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 264 views
  • 0 likes
  • 2 in conversation