You have a powerful SAS function INTNX which you are using - best to use it 
with a DATA step, away from SAS macro environment:

DATA _NULL_;
FORMAT TDY FDT TDT MMDDYY6. ;
TDY = TODAY();
FDT = INTNX('MONTH',TDY,-1); /* first date - prior month */
TDT = INTNX('MONTH',TDY,-1,'E');  /* last date - prior month */
PUTLOG _ALL_;
RUN;

Scott Barry
SBBTech LLC


On Wed, 15 Oct 2025 12:50:29 -0500, Steve Beaver <[email protected]> wrote:

>Does anyone speak SAS?
>
>
>
>What I'm attempting to do is COMPUTE the FIRST day of the MONTH FDT and
>
>Compute the LAST day of the month and it hates me
>
>
>
>
>
>%LET TDY   = %SYSFUNC(TODAY(),8.) ;
>
>%LET FDT   = %SYSFUNC(PUTN(%SYSFUNC(INTNX(DAY,&TDY,-1),8.),MMDDYY6.)) ;
>
>%LET TDT   = %SYSFUNC(PUTN(&TDY,MMDDYY6.)) ;
>
>%LET FDATE = FROM(&FDT 030000) ;
>
>%LET TDATE = TO(&TDT 025959) ;
>
>
>
>DATA _NULL_ ;
>
>    FILE OUTFILE ;
>
>    PUT @02 "EXTRACT SID(FIRA) &FDATE &TDATE" ;
>
>    PUT @10 'SELECT(30,70,101) TAPEVOLCHG(RELEASE) TODD(SMFOUT).' ;
>
>RUN;
>
>
>
>Any assistance would be appreciated
>
>
>
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to