Unfortunately, the error message you describe does not provide any useful information. Are there any other notes, warnings, or errors in the SAS log?
Trying to understand and debug hundreds of lines of macro code is a daunting task. The best I can offer is a few general suggestions about how to reorganize your code:
1. Try to replace your macros with calls to SAS/IML functions.It looks like you only have a few arguments, mostly data set names and cutoff values.
2. You don't need to use a macro variable for the data set name. The language supports expressions for specifying data set names at run time., such as USE (dsname);
3. You can store the long lists of variable names in a character matrix, such as
varNames = {jun04 jul04 ... apr15 may15};
read all var varNames into month_lb;
4. Similarly, use
outNames = "col1":"col484";
create ntrials_months_produced var outNames;
5. The reason your program is "running for many hours" is because
A. You have not vectorized the IML portion of the program, and
B. you are using a macro loops like this:
%do simulation_ID=1 %to 100; %iterate(&output,&avc,&cutoff_stay,&cutoff_exit,&p rices,&spring,&winter,&fall); proc append base=ntrials_stay_rule data=temp_stay_rule;run; ... %end;
See the article "Simulation in SAS: The slow way or the BY way" to understand why the macro loops are inefficient. As you've discovered, it is also difficult to debug macro code, which is why you should try to rewrite the whole program as a single IML program that calls functions.
... View more