BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vicdicenzo
Obsidian | Level 7

I am using SGPLOT and would like those plots saved to a specific folder on my Macbook as JPEGS with a new file name.  The code I used for SAS University Edition worked:

(towards the beginning)

ODS graphics on / reset imagename="new file name" imagefmt =jpeg;
ODS listing gpath = "/folders/myfolders/2020/NCSTB/OUTPUT/dest folder/";

Run;

 

(at the end)

ods rtf close;
run;

 

This is not working with SAS On Demand for Academics.

 

The code generates the plots but I get this error message:

 

WARNING: GPATH or PATH is not a writable directory. It will be ignored.
ERROR: Cannot write image to /pbr/biconfig/940/Lev1/SASApp/stb lf plots22.jpeg. Please ensure that proper disk permissions are set.
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
You cannot do this in the cloud version. You can save it to the cloud location on On Demand and then manually download the files. You could write programs to automatically upload them to a cloud storage process via On Demand using PROC HTTP as well.

View solution in original post

6 REPLIES 6
ChrisNZ
Tourmaline | Level 20

It seems to work for me. Start from this example and see what you add that makes your code fail.

ods graphics on / reset imagename="new file name" imagefmt =jpeg;
ods listing gpath = '%temp%';
proc sgplot data=sashelp.class; 
  scatter x=WEIGHT y=HEIGHT;
run;

NOTE: Listing image output written to %temp%\new file name1.jpeg.

Directory of C:\Users\M771879.CORPNZ\AppData\Local\Temp

26/07/2021 02:45 p.m. 18,072 new file name1.jpeg

 

vicdicenzo
Obsidian | Level 7

Thanks for the code but that did not work.  What other ways can I save the graphs as jpegs?

 

In SAS University Edition, I was able to save to a folder on my MacBook that was backed up to iCloud.

Reeza
Super User
You cannot do this in the cloud version. You can save it to the cloud location on On Demand and then manually download the files. You could write programs to automatically upload them to a cloud storage process via On Demand using PROC HTTP as well.
vicdicenzo
Obsidian | Level 7

Thanks - I got it.

andreas_lds
Jade | Level 19

SAS ODA can't write files to your local computer.

ChrisNZ
Tourmaline | Level 20

He's writing to a Unix path, so I assume he's writing to an ODA path.

This path /pbr/biconfig/940/Lev1/SASApp  is a no-no though as it's the SAS system path.

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!

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
  • 6 replies
  • 1384 views
  • 2 likes
  • 4 in conversation