Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

Reply
Occasional Contributor
Posts: 10

Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

Hi,

I am sure there is a way that both WORK folder in SAS Studio and SAS Enterprise Guide can be synchronized.

If so, how to do it?

I see that the files under the folder which I created under Files in SAS Enterprise Guide, they are synchronized in SAS Studio under My Folders. So by right, those in WORK folder should be able to have the same copies in both SAS Studio and SAS Enterprise Guide, am I correct? But in my SAS Studio under WORK, it is empty, although in SAS Enterprise Guide, there are SAS Data Sets inside. Why?

Super User
Posts: 3,111

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

I think you may be confusing file folders in EG with the WORK library in SAS Studio. These are not the same. The WORK library is for SAS data, the file folders usually for files such as SAS programs.

If you simply want to see the same SAS programs in EG as in SAS Studio you need to create a folder shortcut that points to the same directory as in EG pointing to those files. Open the folders tab in SAS Studio and create a new shortcut to point the correct location.

Occasional Contributor
Posts: 10

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

I have the below code to create a permanent SAS Data Set, using the LIBNAME statement:

LIBNAME TESTS BASE "/home/tanthiamhuat0/Tests" ;
data tests.demographic;
input Gender $ Age Height Weight;
datalines;
M 50 68 155
F 23 60 101
M 65 72 220
F 35 65 133
M 15 71 166
run;

title "Gender Frequencies";
proc freq data=tests.demographic;
tables Gender;
run;

title "Summary Statistics";
proc means data=tests.demographic;
var Age Height Weight;
run;

I did see the TEST library being created, with its dataset.

However, when the SAS Enterprise Guide is re-started, it is no longer there.

how to create a library (with its dataset) which would still exist when the SAS EG is re-started?

Super User
Posts: 3,111

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

Where is the directory you assign with the TESTS SAS library located? Is it on a remote SAS server or is it on your PC? When you say it is no longer there do you mean the dataset is no longer there or the directory as well?

Occasional Contributor
Posts: 10

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

it is on the remote SAS Server. when restarted, both TEST SAS library and dataset is no longer there.

Super User
Posts: 3,111

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

Do you get an error when you assign the LIBNAME TESTS the second time saying something like the directory doesn't exist? Or does it assign without error but the library is empty?

Occasional Contributor
Posts: 10

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

whenever I restart the SAS Enterprise Guide, I see that the library TESTS is no longer there, so I can run the program with

TESTS BASE "/home/tanthiamhuat0/Tests" ;

with no error.

also, when I go to Tools->Assign Project Library,

I see the message that says:

If you want to create a permanent library on a server, create a server library definition by going to menu Tools->Enterprise Guide Explorer, but I do not have that option.

please see 2 attached printscreen.SAS-1.jpg

SAS-2.jpg

Super User
Posts: 3,111

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

As Jaap says you need to talk to your SAS server administrator to find out what is happening to your library or more specifically the directory the library is in: /home/tanthiamhuat0/Tests.

SAS does not delete permanent libraries unless you code a deletion and even then it will not remove the directory, so there must be some type of cleanup process happening on your server to remove it.

Super User
Posts: 6,946

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

So you can execute the libname statement without error, and then the dataset is there?

If yes, your problem is that you did not automate your library assignment. You can either define the library in the metadata or modify the startup commands (autoexec) for the workspace server used in EG and SAS studio.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 17,865

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

I'm going to assume you're referring to the WORK libraries in each of the applications.

The work libraries, by design, are meant to be deleted at the end of each session and are unique to each session. They are meant for work that is not intended to last beyond the current session. You could find the location by right clicking the folder in either location and then manually assigning it in the other location but this doesn't make a lot of sense.

If you'd like your work files to be visible in the two applications its best to use a common library instead of WORK.

Super User
Posts: 6,946

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

WORK is a directory created by a SAS process on startup and deleted on exit. The name is created by using the process number, so that 2 processes running concurrently can NEVER reference the same WORK library.

If you want to access the WORK library of one SAS process in another SAS process, you have to get the physical path name of the WORK library (in EG, right-click on the library in the Libraries tree and select Properties) and then assign a new library in the other. Very tedious.

To share data, set up a permanent library and assign a common libname. Then, instead of using single-level dataset names, use this library for "work" data.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Valued Guide
Posts: 3,208

Re: Synchronize WORK (My Libraries) in SAS Studio and SAS Enterprise Guide

1/ Forget the share of SAS_Work as it is intended to be temporary for every SAS session.

   Do not even trust submitting code within Eguide is having the same work. Code can be run in parallel that is resulting in using many segregated SAS-sessions.

2/ Needing a more fixed permanent location you could use hardcoded libname statements.

   Remember the run those every time over again and again. A better way would be an autoexec approach executed as application start (SASApp server)

   Do not use the personal environment /home with Unix/Linux as Unix-Admin guys are commonly having problems supporting the Agile analytics approach.

   There must be filesystems being setup with storage sizing agreements. It is very common and accepted with Windows dekstops but not with Windows servers and Unix(Linux) environments   

   LIBNAME TESTS BASE "/home/tanthiamhuat0/Tests" ;   The naming is indicating you Unix-admin guys did not have set up some things for that, may be an automatic clean up of your data.

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 11 replies
  • 653 views
  • 0 likes
  • 5 in conversation