Is this a test?
SAS normally stops a data step when it reads past the end of the input data set or text file.
Run this little example to see what I mean.
data _null_;
put 'BEFORE INPUT' _n_= ;
input ;
put 'AFTER INPUT' _n_ = ;
cards;
1
2
3
;
In your second data step the conditions on your DO loops prevent it from reading past the end of the data. So on iteration 1 it does DO MONTH=9,10,11 and then on iteration 2 it does it again, ad infinitum. Add a STOP statement before the RUN statement.
... View more