This question arises from two others I had regarding sending a batch job and also wraping that respective script in a macro for further loops (see here:
- Run SAS batch jobs via SH files: SAS script contains export to csv - where is / how to get the output?
- SAS data step view and data wrap in a macro for loop
My code works as follows:
[1] I define some macro variables
[2] I create a data step view
[3] My data step uses the previous data step view to make some calculation
[4] Export the results
The first time: when I run 1+2, and then run [3]+[4]. The code works. I need to do this once and then I can run 1+2+[3]+[4] (the entire script) altogether. However, if I don't do this "split" run my code gives me the following error message:
116 data xtemp2;
117 set _v_&tables;
117 set _v_&tables;
___
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
118 by symbol date time;
__
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
119 format itime rtime time12.;
.
.
.
and so on, every line afterwards shows the same error. Please note that there are two times line 117, however my code has it only once.
I tried to put a sleep function in between the data steps, but the problem is the same.