To note, as per previous posts I have made here, your code is very sloppy, and hence you are getting problems:
data cork;
input tree$1-3 north east south west;
datalines;
T1 72 66 76 77
T2 60 53 66 63
T3 56 57 64 58
T4 41 29 36 38 <--- Where is the semicolon to finish this? It may not be entirely necessary, but its bad coding!
run;
The question is Then, suppose you submit the following code.
%RandomOrder(cork, 5, 0, outData) <--- again, where is the semicolon to finish this line, this looks like the cause of your issue as this line runs into the next.
what would happen in we printed this out?
Proc print data=outData1;
Run; Proc print data=outData2; <-- Why is this on the same line as the run; from the previous code, are you trying to hide code?
You can also make sure the macro itself exists at the time its called, i.e. somewhre before the call off %RandomOrder(), you need to have defined the macro with %macro RandomOrder;
Of course, also bear in mind the other advice given here in that the process itself isnt good, don't duplicate data just to have a different sort - its wastes disk space and is inefficient coding. Assign flag variables which can then be used in sorts.
... View more