08-15-2013 02:23 PM
Suppose I have a library of SAS datasets that are updated regularly, and I use those datasets to create new analysis datasets for each update. I want to store those new analysis datasets in archived folders. Is it possible to have SAS create a folder in my code, or do I have to manually create the folder and then tell SAS where to store the data?
For example, let's say that I have my base datasets stored in C:\Studies\DrugA\Protocol1\Data. And suppose that I am outputting my analysis data into the following directory: C:\Studies\DrugA\Protocol1\AnalysisDatasets. However, I want to archive them, so I will have a new subfolder for each date I run the data, so I might have the following folders:
Is there a way to set up SAS code to create a folder based on the date the program is run, or do I have to manually create the folder and then change the LIBNAME statement in my code?
08-15-2013 02:36 PM
I think it can, but we just run a DOS command to do it: Here is a sample doing a file move.....
%let cmd = MOVE "&prefix.\From\File.txt" "&prefix.\Archive\File.txt";
08-15-2013 03:17 PM
Live can be that easy when it is done automatic
Need further help from the community? Please ask a new question.