09-25-2016 11:20 PM - edited 09-25-2016 11:33 PM
Can anyone help me to figure out the code that can change a time variable in SAS from HH : MM : SS.SS to HHMM?
like 20:35:00.00 to 2035
Thanks very much!
09-25-2016 11:30 PM
I don't think there's a format, but you can easily create your own using proc format.
proc format; picture mytime other='%0H%0M' (datatype=time); run;
09-26-2016 12:33 AM
Thanks for your answer.
I figured it out just now and it works for my assignment.
Here is the code:
drop OrderTimeNewPart1 OrderTimeNewPart2 OrderTimeNewPart;
09-26-2016 01:51 AM
Your variable is now text. Depending on what you want that may be fine, but in general I find it easier to keep them as date/time/datetime for analysis and calculations later on.