Reputation: 2503
I would like to programmatically reallocate SAS work dir within a script. In other words, standard set up is ok, but, for some tasks, I would like to have some lines of code that change the default settings... Just for that session.
Thanks in advance for your attention
Upvotes: 2
Views: 6348
Reputation: 21264
Use a library called user
. When this library is present, sas defaults all datasets to the user
library instead of the work library.
libname user '/folders/myfolders/proj1';
data want;
set sashelp.class;
run;
proc datasets library=user;
run;quit;
The User library enables you to read, create, and write to files in a SAS library other than Work without specifying a libref as part of the SAS filename. Once you associate the libref User with a SAS library, SAS stores any file with a one-level name in that library. Unlike the Work library, files stored in this library are not deleted by SAS when the session terminates.
Upvotes: 3