Q:

convert character variable to time in SAS

I have a variable called post_time which is of character type 
Type     : Character
Length   :  5 
Foramt   : $5. 
Informat : $5.

eg: 00300 ,01250
How do I get time from this? can someone pls help me out?
need the time to look like 03:00AM 12:50PM 
Need to display all the time in standard time zone

A:

SAS will work directly with this via the HHMMSS informat.
data _null_;
  x = input('02100',HHMMSS5.);
  put x= timeampm9.;
run;

Any time zone concerns can be handled using either a time zone sensitive format, such as NLDATMTZ., and/or the TZONES2U or TZONEU2S functions, which work with DATETIME but may be able to work with your time values if you never go across a date boundary (though using timezones that's risky).
See the SAS Documentation page on Timezones for a more detailed explanation.

