03-28-2016 12:27 PM - edited 03-28-2016 12:32 PM
I’m looking at doing a rather complex data sorting algorithm using temporary tables. Before doing it I’d like to check if this will work. Can I dynamically create a large number of tables e.g. 200 and then merge them together in a set statement dynamically?
I'm looking at using this logic for the set statement
%macro names(prefix,maxnum); %do i=1 %to &maxnum; &prefix&i %end; ; %mend names; /* Call the macro on the SET statement */ data all; set %names(DS,3); run;
03-28-2016 12:48 PM
It could be that you will run out of memory for data set buffers. That's where open=defer can be useful but only if all the SETS have the exact same variables with the exact same length etc.
03-28-2016 12:44 PM
If you are careful with the naming there would be no need for a macro. Since they are temporary then great names like Temp1 to Temp200 suggest themselves. if they are all in the same library then you could use:
set Temp: ;
The : is a list shortcut that says to use all sets that start with Temp.
Need further help from the community? Please ask a new question.