09-07-2017 05:33 AM
So I have a column that looks like this:
data time; input time $4.; datalines; 0930 1000 0800 1300 1530 ; run;
and I want it to look like this:
Which is in a HHMM. or TIME. format
Tried the PUT statement and came back with an error
ERROR: The informat HHMM was not found or could not be loaded.
Is there any simple ways of doing this?
09-07-2017 05:56 AM
Maybe i am blind, but i don't see the mentioned put statement in your code.
I suggest using "hhmmss" instead of "hhmm".
09-07-2017 06:00 AM
I could not find relevant format to read it direclty. But you can use below code to get desired result.
data time(keep=t1 time); input time $4.; t1=substr(time,1,2)*3600 +substr(time,3,2)*60 ; format t1 time5.; datalines; 0930 1000 0800 1300 1530 ; run;
Need further help from the community? Please ask a new question.