07-14-2016 08:36 AM
I am trying to convert this text so I can use the time element in SAS.?
currently stored as CHAR $25
I have managed to extract the time by doing the following but it is still text so cant use to sort by time
How can I then convert to a SAS format
07-14-2016 09:43 AM
Hi yes and I have managed to get that but it is in a char format so when I sort by it, it's not sorting correctly... ie I need 7:30am before 12.30pm etc
07-14-2016 09:11 AM
not elegant but it works.
informat time $25. ;
input time ;
07-14-2016 09:33 AM
In general, the idea is the same as your earlier date question. Use input() with appropriate informat.
Assuming you've isolated the time portiom correctly it will be something like:
Time_sas = input(time, time.);
Need further help from the community? Please ask a new question.