date - Conversion of SAS Macro Variable to time stamp -
i trying convert sas macro variable timestamp , stumped while conversion. code using given below.
%let date = '03/15/2013'; %put %sysfunc(inputn(&date,datetime26.6)); error getting
warning: argument 1 function inputn referenced %sysfunc or %qsysfunc macro function out of range. note: mathematical operations not performed during %sysfunc function execution. result of operations have been set missing value.
please let me know if knows answers this.
that not datetime, date format (to input, depends on incoming data, not outgoing). need remove quotes, sysfunc treats quotes characters, not string delimiters.
%let date = 03/15/2013; %put %sysfunc(inputn(&date,mmddyy10.)); to create datetime, need use put:
%let date = 03/15/2013; %put %sysfunc(putn(%sysfunc(dhms(%sysfunc(inputn(&date,mmddyy10.)),0,0,0)),datetime26.)); however, better way if can use date constant...
%let date=15mar2013; %put "&date."d;
Comments
Post a Comment