@Ronein wrote:
Hello
I want to create 3 sas macro varaibles :Today,yesterday,same day in the prior month from yesterday.
data _null_; call symputx('Today', PUT(intnx('DAY',today(),0), date9.)); * Today; call symputx('d_yesterday', put(today()-1, date9.)); * yesterday; call symputx('beta', PUT(intnx('MONTH',today()-1,-1,'s'), date9.)); *last month same day of yesterday; RUN; %put &Today.;/*10JUL2018*/ %put &d_yesterday.;/*09JUL2018*/ %put &beta.;/*09JUN2018*/
When I did it in another way I received an error.
May someone tell me please why is the error?
%let d_today=%sysfunc(today()); %put &d_today.; data _null_; call symputx('d_yesterday', PUT(intnx('DAY',&d_today.,-1), date9.)); * yesterday; call symputx('beta', PUT(intnx('DAY',%SYSFUNC(&d_today.),-1), date9.)); *last month same day of yesterday; RUN; %put &d_yesterday.; %put &beta.;
From now on, could you please post your code in the proper format, by clicking on the running man icon, then pasting your code into the window that opens? Thanks.
... View more