@ballardw's suggested rewrite is good under normal circumstances, but could hide the problem here. If the problem is that &DISP_RECORDS is actually 5, your original program will generate the error that you mentioned. But this rewrite will create the output data set (with no subsetting applied). Until the program is debugged, you could start out by temporarily adding this as the first statement within your macro:
%put DISP_RECORDS is &disp_records;
The other suggestions, such as temporarily turning on MPRINT, are excellent.
... View more