10-20-2016 03:51 PM
Could you please let me know how I can conditionally rename a dataset?
eg: I have dataset TEST in a library.
So if the run month=01 then I need to rename TEST to TEST_01.
10-20-2016 04:03 PM
What rule are you using to determine that the "run month = 01"?
And since this is a date related question what do you want to do the following year when there is another "run month=01"?
Are also asking "how do I determine if the data set TEST exists in the library I expect it to?"
10-20-2016 04:11 PM
I set the macro variable , for eg: mth according to the date when I run the program.
So I plan to run the process only on the month of January all other months are not affected.
Data set should be avaialbe in the library from the previous months run.
10-20-2016 05:03 PM
I'm not sure how much I undesstood your problem.
%let month= %sysfunc(month("&sysdate"d));
10-20-2016 10:23 PM - edited 10-20-2016 10:26 PM
data test; set sashelp.class; run; proc datasets library=work nodetails nolist; change test=test_%sysfunc(month(%sysfunc(today()))); quit;
data test; set sashelp.class; run; %let month=01; proc datasets library=work nodetails nolist; change test=test_&month; quit;