Just replace the macro variable with TODAY()
Data _null_;
FORMAT FirstDayofReportingMonth_dt LastDayofReportingMonth_dt REPORTING_DT DATE9.;
FORMAT REPORTING_DTTM DATETIME23.;
FirstDayofReportingMonth_dt = INTNX ('MONTH', TODAY(), -1, 'B');
LastDayofReportingMonth_dt = INTNX ('MONTH', TODAY(), -1, 'E');
call symput("FirstDayofReportingMonth", put (FirstDayofReportingMonth_dt, yymmddn8.));
call symput("LastDayofReportingMonth", put (LastDayofReportingMonth_dt, yymmddn8.));
REPORTING_DT = LastDayofReportingMonth_dt;
REPORTING_DTTM = INPUT (PUT (REPORTING_DT, DATE9.) || ':23:59:59', DATETIME18.);
call symput("reporting_date", put (REPORTING_DT, date9.));
call symput("reporting_datetime", left (put (REPORTING_DTTM, datetime23.)));
call symput("reporting_num_date", put (REPORTING_DT, yymmddn8.));
Run;
... View more