Hello.
To read in your data, I suggest you use a macro %do loop in place of calling the macro over and over. I worked up an example of the logic you can use:
options mprint symbolgen; %macro readjunjul; data _null_; yr=year(today())-2000; /* to get a 2 digit year*/ call symput('thisyear', left(put(yr,8.))); call symput('lastyear',left(put(yr-5,8.))); call symput ("month1",'06'); call symput ("month2",'07'); stop; run;
%do i=&lastyear %to &thisyear; %do j=1 %to 2; data _null_; put "&i"; put "&&month&j.."//; run; %end; %end; %mend; %readjunjul;
Replace the second data null step with your data step that reads in the text file.
You can use similar logic to create one data set that contains all the data. Then to compute your average change you can follow the logic from this example in the PROC MEANS documentation:
https://support.sas.com/documentation/cdl/en/proc/68954/HTML/default/viewer.htm#p074ebrvnxe5yan1ii4rykkqp3o9.htm
Michelle
... View more