BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Andy_D
Fluorite | Level 6

How do I pull in datasets from the work library from another SAS session/project?

 

Thanks in advance,

Andy

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Andy_D,

 

  1. Determine the path of the work library in question, e.g., by submitting this in the other session:
    %put %sysfunc(pathname(work));
  2. Use the path in a LIBNAME statement as usual (in the main session):
    libname work2 'the_path_goes_here';

View solution in original post

4 REPLIES 4
FreelanceReinh
Jade | Level 19

Hi @Andy_D,

 

  1. Determine the path of the work library in question, e.g., by submitting this in the other session:
    %put %sysfunc(pathname(work));
  2. Use the path in a LIBNAME statement as usual (in the main session):
    libname work2 'the_path_goes_here';
ballardw
Super User

Since presumably this is someone else's work library and it might not be friendly to delete or overwrite data sets there, or if the intent is only to read data from that library it might be a good idea to use the Libname option Access=Readonly.

FreelanceReinh
Jade | Level 19

This is a good point which I forgot to mention. I was not even sure that my suggestion would work for the OP because of possibly insufficient (read) permissions. Most often, I use this technique when working with two or more SAS sessions in parallel.

ballardw
Super User

@FreelanceReinh wrote:

This is a good point which I forgot to mention. I was not even sure that my suggestion would work for the OP because of possibly insufficient (read) permissions. Most often, I use this technique when working with two or more SAS sessions in parallel.


I have the luxury (?) of not working in a server environment so I also was not sure that permissions would allow the connection, or at least not without an Admin's help. But I do work with shared network location libraries and try to not accidentally corrupt my supervisors data. Smiley Wink

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1041 views
  • 2 likes
  • 3 in conversation