Hi,
I have the below call symput statements, when I run for the first time &st_dt. and &en_dt. wont resolve to actual values, but the second run resolves it. Could you please let me know why?
First run has the warnings in the log saying that &dte1 and &dte2 not resolved but second run has no warnings.
data _null_; date1=put(intnx('month',today(),-1,'beginning'),yymmdd10.); call symput('dte1',date1); call symput ('st_dt',"'&dte1.'"); date2=put(intnx('month',today(),-1,'e'), yymmdd10.); call symput('dte2',date2); call symput ('en_dt',"'&dte2.'");
run; %put &dte1.; %put &dte2.; %put &st_dt.; %put &en_dt.;
1 data _null_; 2 date1=put(intnx('month',today(),-1,'beginning'),yymmdd10.); 3 call symput('dte1',date1); 4 call symput ('st_dt',"'&dte1.'"); WARNING: Apparent symbolic reference DTE1 not resolved. 5 date2=put(intnx('month',today(),-1,'e'), yymmdd10.); 6 call symput('dte2',date2); 7 call symput ('en_dt',"'&dte2.'"); WARNING: Apparent symbolic reference DTE2 not resolved. 8 9 10 run;
NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
11 %put &dte1.; 2016-11-01 12 %put &dte2.; 2016-11-30 13 %put &st_dt.; '&dte1.' 14 %put &en_dt.; '&dte2.' 15 data _null_; 16 date1=put(intnx('month',today(),-1,'beginning'),yymmdd10.); 17 call symput('dte1',date1); 18 call symput ('st_dt',"'&dte1.'"); 19 date2=put(intnx('month',today(),-1,'e'), yymmdd10.); 20 call symput('dte2',date2); 21 call symput ('en_dt',"'&dte2.'"); 22 23 24 run;
NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
25 %put &dte1.; 2016-11-01 26 %put &dte2.; 2016-11-30 27 %put &st_dt.; '2016-11-01' 28 %put &en_dt.; '2016-11-30'
... View more