Hello everyone,
I am trying to learn parallel programming following this article :
https://www.mwsug.org/proceedings/2013/BI/MWSUG-2013-BI07.pdf
I try to assign the client library to the same location as my server work library so that I can access the files in the server work library in every subtasks.
The problem is that although %sysfunc(pathname(work)) reports the path of the work library, (C:\Users\Admins\AppData\Local\Temp\SAS Temporary Files\_TD6236_ADMIN-1070205A_), my datasets in the work library is not actually there since I use the in-memory work library (MEMLIB).
Could you please help me find the location of my in-memory work library? Or is there any other suggestion for my problem? Thank you very much.
Yun
Here is my code:
libname shared "%sysfunc(pathname(work))";
data pt; /*generate sample dataset*/
do pt=1 to &numPt;
gender = ifc(uniform(&seed) > .45, 'M', 'F');
output;
end;
run; rsubmit task1 wait=no inheritlib=(shared); /*use inheritlib to set shared to the server work library*/
data shared.task1;
set shared.pt; /* <-- ERROR: File SHARED.PT.DATA does not exist. */
run;
endrsubmit;
Don't share WORK libraries between SAS sessions as they are designed to be separate. Share permanent SAS libraries instead.
Thank you for replying. I'll try to figure out if there is any way to share other in-memory library other than the work lib.
How are you defining it for WORK? You should be able to do it by replacing the WORK directory reference with a permanent directory reference.
I have also tried to share an in-memory library other than the WORK library. It does not work either. I get the same error for the following code. Howerver, the code wroks fine without the MEMLIB option.
Here is my full code.
libname shared "D:\Research\Parallel Data" MEMLIB;
data shared.pt; /*generate sample dataset*/
do pt=1 to 1000;
gender = ifc(uniform(123) > .45, 'M', 'F');
output;
end;
run;
%let rc=%sysfunc(grdsvc_enable(_all_, resource=SASApp));
options autosignon;
rsubmit task1 wait=no inheritlib=(shared);
data shared.task1;
set shared.pt;
run;
waitfor _all_ task1;
endrsubmit;
Try repeating your libname statement in the RSUBMIT block. Also test without MEMLIB - does that work?
I'm not sure if you can share MEMLIB libraries across SAS sessions. This link says a MEMLIB library is lost at the end of a SAS session:
I suggest you track this to SAS Tech Support for a definitive answer.
Thank you for the suggestion. I tried that before and it didn’t work either. Maybe it is not a good idea to share the MEMLIB across SAS sessions.
I will try to contact tech-support. Thank you very much.
@myun1 no problem. Still worth using parallel SAS sessions with permanent SAS libraries though to speed performance.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.