I want to be able to find the number of months between 2 dates. The first date will always be 30 June 2014. My end date will always be the last day of the previous month. I want to then be able to use that number in other parts of code. I.E. Between 30th June 2014 and 31st August 2020 there are 74 months. I want to then be able to call on that 74 in a later For loop. I have tried something like this from using another code but I can't get it to work. data _null_;
call symput('month_end', put(intnx('month',today(),0)-1,date9.));
call symput('start_date', put(intnx('month','30Jun14'd,0),date9.));
RUN;
%put &month_end.;
%put &Start_date.;
data a;
NumberOfMonths = INTCK('MONTH', '30Jun14'd, &month_end., 'D');
RUN;
... View more