BookmarkSubscribeRSS Feed
tomcarey
Calcite | Level 5

I'm trying to assign  a library at startup, so added the following to the autoexec file:

%let path=/folders/myfolders/;
libname orion "/folders/myfolders/";
run;

 

However the autoexec doesnt seem to run upon startup in SAS studio University Edition,  are there any startup logs I can look at?

After startup, if I go to Edit autoexec file and select run, then the library is assigned.

 

Note: I'm a newbee so it's probably something stupid.

11 REPLIES 11
Shmuel
Garnet | Level 18

I'm using SAS UE.

Change your code to:

%let path=/folders/shortcuts/myfolders/;
libname orion "/folders/shortcuts/myfolders/";
Reeza
Super User

@Shmuel Thats only necessary if you've incorrectly created the myfolders for some reason.

 

@tomcarey How does it not work? Is the library not assigned? Note that what you're doing there is creating a macro variable that's not used and assigning a library. If this is for one of the courses I think the path should be longer and have the course folder name as well.

Shmuel
Garnet | Level 18

@Reeza, using linux, I have defined the directory as:

 

     ~/SASUniversityEdition/myfolders

 

did I miss anything ?

Reeza
Super User

Is it all lower case in your computer as well? And did you set the shared path to SASUE or myfolders?

tomcarey
Calcite | Level 5
yes lower case, shared path set to myfolders
tomcarey
Calcite | Level 5

thanks for the responses.

I bring up SAS studio from scratch (including starting the Oracle VM VirtualBox), then I select a program that the teacher gave us,

it is listed in the right hand side of SAS Studio and lives in the myfolders directory on my server.

I try to run the prgram but it does not work.

I then go to Edit Autoexec file, select run, (it runs successfully) then I go back and re-run the program and this time it runs.

So I'm guessing the autoexec did not run, or am i missing something?

 

Here is one of the sampels I tried:

/********************************************************************/
/* This program uses an INFILE statement to read a raw data file. */
/* The INFILE statement includes a full path for Microsoft Windows. */
/* */
/* For UNIX or SAS onDemand: */
/* Replace the INFILE statement with the following statement: */
/* infile "&path/newemps.csv" dlm=','; */
/* */
/* For z/OS: */
/* Replace the INFILE statement with the following statement: */
/* infile "&path..rawdata(newemps)" dlm=','; */
/********************************************************************/

daat work.newsalesemps;
length First_Name $ 12
Last_Name $ 18 Job_Title $ 25;
infile "&path\newemps.csv" dlm=',';
input First_Name $ Last_Name $
Job_Title $ Salary;
run;

proc print data=work.newsalesemps
run;

proc means data=work.newsalesemps average min;
var Salary;
run;

 

thanks 

Shmuel
Garnet | Level 18

You have just two lines in your AUTOEXEC.

Check, immediate after entering SAS Studio, by:

 

1) %PUT PATH = &path;  >>> check the log. What do you see ?

     Have you got a message that macro variable PATH is not resolved?

 

2) On left you have Libraries. Expand it - is there a library named ORION ?

 

 

tomcarey
Calcite | Level 5
Here is what I get - it shows PATH as blank:
62 %PUT PATH = &path;
PATH =

Yes there is a library called ORION.
The commands work when run from the Autoexec run dialog, so I assume they would break if they couldn't find Orion. However, the PATH variable being blank may be the clue. I'll investigate that further.
THanks
Shmuel
Garnet | Level 18

Try adding %GLOBAL PATH;  in the autoexec - line before the %LET

and check again after entering a new session.

 

Does it help? 

 

tomcarey
Calcite | Level 5
Hi Shmuel,
Unfortunately that also did not work.
Is there any logs I can look at to try and find out what's happening?
thanks
Shmuel
Garnet | Level 18

I'm using SAS UE in linux. After checking several options I found:

 

1) You are right, %LET PATH doesn't work

2) Changing the macro variable to ROOT or MYPATH (and probably ant other valid name) did work.

 

It seems that sas studio uses PATH for its own needs when launching a new session 

and then resets it.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2577 views
  • 4 likes
  • 3 in conversation