10-27-2017 06:28 AM
I m trying to do sas date function using sas macro and i need below output.
%let a= %sysfunc(intnx(day,%sysfunc(today()),-1),yymmdd10.);
but need output should be .
within the code.
Please guide me how would be do it.
10-27-2017 07:25 AM
Where do you use the macro variable? Depending on the use, both the format and the quotes might not be necessary.
10-27-2017 07:47 AM
If you have to do this in macro, you could precede and follow you expression with %str(%'), as in:
%let a= %str(%')%sysfunc(intnx(day,%sysfunc(today()),1),yymmdd10.)%str(%'); %put &=a;
10-27-2017 11:25 AM
Personally I'm not a fan of including quotes in macro variables, I prefer to leave them unquoted and then use with quotes as necessary. It makes them more versatile in the long run and allows for multiple uses.