I need to automate the date by only having the user to hard code the year and month. The below program works perfectly fine for the month of 10, 11 and 12 but did not work for month from 1 to 9. I realized this is due to single digit of month instead of double digit. Could anyone help on this? Be noted I use this method to atuomate the date is because in the later of the program, there will be SQL pass through between other databases, so I have to automate the date in both of date9. (‘01nov2019’d) And yymmdd10 (2019-11-01) format. %LET YYYY = 2019; /* year*/ %LET MM = 11; /*month*/ DATA _NULL_; CURRENT_MONTH = input(cats(&YYYY,&MM,"01"),yymmdd8.) ; SASD1 = quote(put(CURRENT_MONTH,date9.),"'")||"D" ; SASD2 = quote(put(intnx('MONTH',CURRENT_MONTH,0 ,"E"),date9.),"'")||"D" ; SQLD1 = quote(put(CURRENT_MONTH,yymmdd10.),"'") ; SQLD2 = quote(put(intnx('MONTH',CURRENT_MONTH,0 ,"E"),yymmdd10.),"'") ; CALL SYMPUT('SASD1',SASD1); CALL SYMPUT('SASD2',SASD2); CALL SYMPUT('SQLD1',SQLD1); CALL SYMPUT('SQLD2',SQLD2); RUN; %PUT &SASD1 &SASD2 &SQLD1 &SQLD2; %PUT &SASD1 &SASD2 &SQLD1 &SQLD2; '01NOV2019'D '30NOV2019'D '2019-11-01' '2019-11-30'
... View more