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

I have the following code in an autoexec.

*ODS STATEMENTS RESET;
options mrecall;
%macro odsReset;
ods path reset; 
ods _ALL_ close; 
ods trace on;
ods noptitle; 
ods graphics on;
ods listing;
%mend odsReset;
%odsReset;

*ODS GRAPHICS;
*The default location is the current directory for the SAS program that generated the graphic image;
%let sasworklocation="%trim(%sysfunc(pathname(work)))";
ods listing gpath=&sasworklocation; 

The past day I am getting an error message concerning disk permissions I don't understand. Please see attached file. Can you help? 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Either your autoexec has been circumvented, or overridden by later code. Run these statements as part of your output code:

%let sasworklocation="%trim(%sysfunc(pathname(work)))";
ods listing gpath=&sasworklocation

If you use other ODS destinations, make sure that the same path is used.

Keep in mind that using the WORK location means that the images will vanish once you end your SAS session.

View solution in original post

5 REPLIES 5
Reeza
Super User
Explicitly set where you would like your graphs saved.

ods listing / gpath = 'path to save my graphic files';
MaryA_Marion
Lapis Lazuli | Level 10

Thank you for the reply. I found that the following code works for different procedures. I have to include it immediately before the plot code.

ods listing gpath = '/home/u... /Stat.XXX.graphs';
ods graphics on / imagename ="DiagnosticsPanel" imagefmt=tiff;

I like each graph to have a name I chose. Am I doing it correctly?

 

 

Kurt_Bremser
Super User

Either your autoexec has been circumvented, or overridden by later code. Run these statements as part of your output code:

%let sasworklocation="%trim(%sysfunc(pathname(work)))";
ods listing gpath=&sasworklocation

If you use other ODS destinations, make sure that the same path is used.

Keep in mind that using the WORK location means that the images will vanish once you end your SAS session.

Kurt_Bremser
Super User

And please do always (as in ALWAYS) post your log by copy/pasting it into a window opened with this button:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

Having to repeatedly switch between the pdf previewer and the main post while composing an answer is a PITA. And we can't copy/paste log excerpts from a picture.

Kurt_Bremser
Super User

And to give you some technical background:

Whenever you let SAS create something without an explicit absolute path, the SAS session will try to put that in its current working directory, which is the location of the script that started SAS on the backend (or a location set within that script). This location is (in server-based SAS setups) within the SAS configuration tree, where only the SAS installation user (or the superuser, as you are on UNIX) have write permission.

An absolute path starts at the root of the filesystem (/ in UNIX, or a drive letter/backslash or UNC location in Windows). SAS On Demand allows the use of the tilde (~) as an absolute path to your home directory; you could also use $HOME for that.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 481 views
  • 1 like
  • 3 in conversation