Macro variable is text replacement, so your macro variables are replaced where you indicate which resolves to: 11568 %PUT &startmonth &endmonth; "201506" "201508" Which translates to "&startmonth" <= YearMonth <= "&endmonth" ""201506"" <= YearMonth <= ""201508"" Issues with this: 1. too many quotation marks 2. Types don't match char vs num. Fix: 1. Remove quotes from macro variable 2. Remove quotes from And condition %LET date = %SYSFUNC(today()); %LET startmonth = %SYSFUNC(intnx(month,&date,-6),yymmn6.); %LET endmonth = %SYSFUNC(intnx(month,&date,-4),yymmn6.); %PUT &startmonth &endmonth; AND &startmonth <= YearMonth <= &endmonth
... View more