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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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