If you want to save all the data sets with common beginning characters then the : list modifier may be of interest. This would save all the data sets whose names start with Pat_ .
proc datasets library=work;
save pat_:;
run;
quit;
You can also use a list name range. You haven't provided much detail as to what may exist but if the other data sets have names with the same base but different sequence numbers, assuming your _1 is a "sequence" then something like this would save myres1_2, myres1_3 ... myres1_9. Caveat: all of the sequence numbers from 2 through 9 (or what ever you want) have to exist for the list to work.
Proc datasets lib=work;
save myres1_2 - myres1_9;
run;
quit;
@NewUsrStat wrote:
Hi guys,
I'm trying to remove all intermediate files that are created while running a script.
However, I would like to retain only a specific one, the most important whose name is the following: myres1_1
I used the following:
proc datasets lib=work;
save myres1_1;
quit;
What if I want to use a regex to specify the pattern "myres1*" instead of the full name? I have to concatenate many script so I cannot specify every time the name and hence the pattern will be useful.
Thank you in advance