BookmarkSubscribeRSS Feed
tanthiamhuat
Calcite | Level 5

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?

11 REPLIES 11
SASKiwi
PROC Star

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.

tanthiamhuat
Calcite | Level 5

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?

SASKiwi
PROC Star

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?

tanthiamhuat
Calcite | Level 5

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

SASKiwi
PROC Star

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?

tanthiamhuat
Calcite | Level 5

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

SASKiwi
PROC Star

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.

Kurt_Bremser
Super User

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.

Reeza
Super User

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.

Kurt_Bremser
Super User

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.

jakarman
Barite | Level 11

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 --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 11 replies
  • 1595 views
  • 0 likes
  • 5 in conversation