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