Hi all, I'm having some issues getting the following code to execute as intended: %macro ck (start=, end=); %let start=%sysfunc(inputn(&start.,YYMMN6.)); %let end=%sysfunc(inputn(&end.,YYMMN6.)); %let dif=%sysfunc(intck(month,&start.,&end.)); %do i=0 %to &dif.; %let date=%sysfunc(intnx(month,&start.,&i.,b),YYMMN6.); %put &date.; %let date2=%sysfunc(intnx(month,&date.,1)); %put &date2.; %end; %mend ck; %ck(start=201701,end=201802); The macro variable date is executing the way I'd like it to, looping through 201701 to 201802, but date2 is not. I am trying to have date2 be one month later than date. My log shows the following: Why does SAS think that 201701 + 1 month is 201705? As the loop progresses the values for date2 get further out of expected range. I'd appreciate any feedback and help, thank you.
... View more