SASUnit Examples  Version 1.5.0
_timestamp.sas
Go to the documentation of this file.
1 
28 %MACRO _timestamp(dt);
29  %LOCAL dt d t;
30  %IF &dt= %THEN %LET dt=%sysfunc(datetime());
31  %LET d=%sysfunc(datepart(&dt));
32  %LET t=%sysfunc(timepart(&dt));
33  %LET h=%sysfunc(hour(&t));
34  %LET m=%sysfunc(minute(&t));
35  %LET s=%sysfunc(second(&t));
36  %sysfunc(putn(&d,yymmdd10.))-%sysfunc(putn(&h,z2.))-%sysfunc(putn(&m,z2.))-%sysfunc(putn(&s,z6.3))
37 %MEND _timestamp;