BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nietzsche
Lapis Lazuli | Level 10

Hi, I am reading page 338 of the official specialist base exam prep guide. The book says to reset the ODS destination to HTML output at the end of your programs with this code.

ods html path="%qsysfunc(pathname(work))";

Nietzsche_0-1668717841411.png

Is this code generic as it is or do I need to change the pathname or my system path?

ods html path="%qsysfunc(/home/u62043935/(work))";

or something as I am a studio user?

 

sorry if the question sounds stupid.

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
1 ACCEPTED SOLUTION

Accepted Solutions
Sundaresh1
SAS Super FREQ

Hi @Nietzsche, Printing the macro in SAS Studio, I get : 

 

%put %qsysfunc(pathname(work));
/opt/sas/viya/config/var/tmp/compsrv/default/1784d302-ce0e-459a-8c14-2ba87739be2b/SAS_work745C00000215_sas-launcher-a45f1928-0ae2-45
9e-9ec1-27874a58c13a-1834

 

which corresponds to the work directory allocated within my pod when the SAS Studio session was launched.  You do not need to change the parameter 'work'.

 

Note that this remains the same for the entire session.  If you access SAS Studio from another Incognito window / Private window in the same workstation (i.e. you have to log in again),  you will notice that the work directory has changed (because it's a different session).

 

regards,

Sundaresh

 

View solution in original post

4 REPLIES 4
Sundaresh1
SAS Super FREQ

Hi @Nietzsche, Printing the macro in SAS Studio, I get : 

 

%put %qsysfunc(pathname(work));
/opt/sas/viya/config/var/tmp/compsrv/default/1784d302-ce0e-459a-8c14-2ba87739be2b/SAS_work745C00000215_sas-launcher-a45f1928-0ae2-45
9e-9ec1-27874a58c13a-1834

 

which corresponds to the work directory allocated within my pod when the SAS Studio session was launched.  You do not need to change the parameter 'work'.

 

Note that this remains the same for the entire session.  If you access SAS Studio from another Incognito window / Private window in the same workstation (i.e. you have to log in again),  you will notice that the work directory has changed (because it's a different session).

 

regards,

Sundaresh

 

SASKiwi
PROC Star

The folder SAS uses for the WORK library changes with each new SAS session and that includes SAS Studio. That is why using the PATHNAME example is the way to go. It will work regardless of whether you a using a SAS Studio session, running a SAS batch job and so on.

Cynthia_sas
SAS Super FREQ

Hi:

  The WORK library is a temporary library and is stored in a temporary location on the server. The WORK location is automatically closed and the folder deleted when you end your SAS session. On SAS OnDemand, WORK is not under your HOME folder on the server. So the code would be OK as shown in the book without changes.

 

  You can see the location of the WORK library by submitting this code in your session:

%put WORK path is: %qsysfunc(pathname(work));

And in the output, you'll see that the HOME folder and the userID for the test account are not visible in the path for the WORK library.

 

  Here's the screen shot of what it looks like on my test account:

Cynthia_sas_0-1668720442589.png

 

  Depending on the operating system where you're running SAS and the defaults set by your system administrator, you may or may not have your default path directed to the WORK library. On my Windows install of SAS, my default location for ODS HTML is the WORK location, so I do use this technique; however, on other systems, my default location is a write access folder or a different temporary location, so I don't use this technique -- I direct the output to a different folder. The downside of this technique is that WORK is deleted at the end of each session. If I direct my output to my personal write access folder, then I am responsible for doing the clean-up.. 

Cynthia

 

Nietzsche
Lapis Lazuli | Level 10

Thank you Cynthia for the detailed screenshot.

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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