Ever had a problem with a SAS session, but been unable to close the session due to having critical files in your remote work library (RWORK)??
I certainly have! So how do you access that library from another (new) session?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a macro I wrote to assign a multiple libref to all remote work directories owned by you :
rsubmit ; %MACRO DOUBLELIB(USER=&SYSUSERID,LIB=double) / des="Assign libname of double for multiple SAS sessions for the same user"; options nosymbolgen nomprint ; %LET WRK = %SYSFUNC(pathname(work)) ; %LET WRKDIR = %SYSFUNC(scan(&WRK,-1,/)) ; %LET SASTEMP = %SYSFUNC(tranwrd(&WRK,&WRKDIR,)) ; filename mywork pipe "ls -ls &SASTEMP" ; data zwork ; infile mywork lrecl=512 recfm=v pad ; input @1 char $512. ; if index(upcase(char),upcase("&USER")) and ^index(char,scan("&WRK",-1,'/')) and index(char,'SAS_work'); path = scan(char,-1,' ') ; n + 1 ; call symput('PATH'||compress(n),"&SASTEMP"||strip(path)) ; call symput('PATHN',compress(n)) ; run ; %NOBS(zwork) ; %IF &NOBS > 0 %THEN %DO ; libname &LIB ( %DO I = 1 %TO &PATHN ; "&&PATH&I" %END ; ) access=readonly ; %END ; options symbolgen mprint ; %MEND DOUBLELIB; %DOUBLELIB(LIB=dblwork) ; endrsubmit ; /* Assign local libref to new remote dblwork libref */ libname rdouble slibref=dblwork server=myserver ;