I am trying to increment a date by one day so it is the beginning of a month and have it appear in a report title. Once I have the answer, the date will be a variable selected by the user that is actually an end-of-month date.
%let x=intnx('DAY', '31Mar08'd,1);
%put x / x date9.;
The problem is that you are mixing macro-code and normal sas-code. In this case the intnx-function will never be executed. Some functions can be used in macro-statements via the %sysfunc-macro-function.
The following code uses a data-step to create the macro-variable firstDay.
When I try to put Prior_Month_End in the sysfunc
%let beg_date = %sysfunc(intnx(day,&prior_month_end,1,beginning));
Result: . (period)
w/out the '&' on Prior_Month_End, I get an error message.
When I try it a different way, it appears the "value" for Prior_Month_End "starts at 1/1/1960.
%let beg_date = %sysfunc(intnx(day,%sysfunc(Datepart(&Prior_Month_End),