I found this
%let P = %sysfunc(inputn(%sysfunc(putn(%sysfunc(intnx(month,%sysfunc(today()),&D.-1,B)),z6.)),DDMMYYN10));
in my mailbox.
Apart from the fact that it creates a raw value instead of a formatted date (which was expected), it looks like a serious attempt of someone who gets a kick out of hurting him/herself.
It violates several Maxims, notably Maxim 12 and parts of Maxim 11.
It is a bear to type correctly (at which it failed anyway), is hard to read for the next maintainer, and hard to debug.
Instead do
data _null_;
mydate = intnx(month,today(),&D.-1,"b");
call symputx('P',put(mydate,best.),'g');
run;
and use macro variable P directly, without "&P."d. (where somedate <= &P.)
... View more