Redirect libref to WORK library in SAS

Imagine you have a SAS Enterprise Guide Project, where you have been using a libref (let's name it "SAVE") very often. However, now you want to switch it in specific occassion turn to WORK library so that it does not require a specific folder for SAS datasets to be saved. Also, you would still like to have the LIBNAME statement for SAVE libref, so that you can switch easily from WORK libref to specific path. so, the following two solutions you can use:
LIBNAME save %sysfunc(quote(%sysfunc(pathname(work)))) ;
the second way to do it is the following:
%let workLocation=%sysfunc(getoption(work));
libname SAVE "&workLocation.";

Comments

Popular posts from this blog

Timeline on Latex

Exporting Skype Chat/Skype Contacts to csv file using the shell script and sqlite3 (usually already installed on mac)

trim() not supported by IE7 and IE8