@Tom wrote:
@Kurt_Bremser wrote:
Subtract 7 from the date. To make (integer) calculations in macro language, use the %EVAL function:
%let d=%sysfunc(week(%eval(%sysfunc(today())-7)),z2.);
Note that if the expression is being passed as an argument to a SAS function via %SYSFUNC() you don't need to use %EVAL() to do the calculations before hand.
338 %let x1=%sysfunc(week(%eval(%sysfunc(today())-7)),z2.);
339 %let x2=%sysfunc(week(%sysfunc(today())-7),z2.);
340
341 %put &=x1 &=x2;
X1=10 X2=10
A NUMERIC argument that is.
346 %put |%sysfunc(putn(5+6,Z5.))|;
|00011|
347 %put |%sysfunc(putc(5+6,$5.-R))|;
| 5+6|
And - tadaa! - once again I learned something new here.