> From: Rob Rohrbough [mailto:Rob@ROHRBOUGH-SYSTEMS.COM]
> In my wildest dreams, I would like to do the following:
> data _null_;
> x = '1120';
> y = input(x, hhmm4.);
> put x= y=;
> SAS8 does not appear to have a four-character time format to
> input hours and minutes, as in "hhmm4.", above. Am I wrong?
> There seems to be no "HHMM" format, and neither time4. nor
> time5. work on a value like "1120".
> Any suggestions other than cracking the silly thing myself?
> (like translating it to "11:20")
not to worry, SAS has a number of round flat things
with hole in middle
see formats: timeW.d and timeAMPMw.d
%LET TIME = %sysfunc(time(),time8.0) ; %*HH:MM:SS;
%LET TIME_HH = %scan(&TIME.,1,:) ;
%LET TIME_MM = %scan(&TIME.,2,:) ;
%LET TIME_SS = %scan(&TIME.,3,:) ;
%LET TIMEAMPM = %sysfunc(time(),timeAMPM8.0); %*HH:MM AM;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov