BookmarkSubscribeRSS Feed
myun1
Calcite | Level 5

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;

 

 

7 REPLIES 7
SASKiwi
Opal | Level 21

Don't share WORK libraries between SAS sessions as they are designed to be separate. Share permanent SAS libraries instead.

myun1
Calcite | Level 5

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. 

SASKiwi
Opal | Level 21

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.

myun1
Calcite | Level 5

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;
SASKiwi
Opal | Level 21

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:

https://documentation.sas.com/?docsetId=hostwin&docsetTarget=p041tbb02reefnn1jmup3zo7tirr.htm&docset...

 

I suggest you track this to SAS Tech Support for a definitive answer.

myun1
Calcite | Level 5

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.

SASKiwi
Opal | Level 21

@myun1 no problem. Still worth using parallel SAS sessions with permanent SAS libraries though to speed performance.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 900 views
  • 0 likes
  • 2 in conversation