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

I've recently moved to the SAS/EG environment to submit my SAS jobs.   I'd like save my proc gplots (SAS/Graph) to a named GIF (or JPEG) filename in a specific local directory so I can use them later in a custom web app.

 

I cannot figure out how to do this.  proc gplot in SAS/EG seems to ignore gsfname=.   I think it's because it's wrapped in ODS.

 

Should I switch to proc sgplot and use ODS (I'm not familiar with this method)?

Or is there a way in SAS/EG to use SAS/Graph and redirect the output to a named gif filename?

Thanks,

Steve

 

 

 

* this doesn not make gif chart at the named filename;

filename graphout "&dir0\brs_m29.gif";

goptions gsfname=graphout gsfmode=replace device=gif;

proc gplot data=freq03;

  plot percent * yq = finalrating / grid ;

  run;

  quit;

 

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

I don't use EG so just guessing here, but if it is ods then you could put before your code:

ods _all_ close;

That would turn off all destinations.  You may also want to check what the &dir0 represents and if SAS has access to it.

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

I don't use EG so just guessing here, but if it is ods then you could put before your code:

ods _all_ close;

That would turn off all destinations.  You may also want to check what the &dir0 represents and if SAS has access to it.

Darrell_sas
SAS Employee

Basically the following:

filename graphout "c:\";

goptions reset=all device=gif gsfname=graphout;

ODS _all_ CLOSE;

ODS LISTING;

proc gplot data=freq03;

plot percent * yq = finalrating / grid name="m29";

run;

quit;

ODS LISTING CLOSE;

 

ruegsegs_us_ibm_com
Fluorite | Level 6

Adding ods_all_close; was part of it.

I then needed to turn on "ods listing;"    I don't fully understand it, but those two lines (47 & 48 below) did it for me.  

 

 

 

47         ods _all_ close;
48         ods listing;
49         
50         
51         filename graphout "&dir0\brs_m29.gif";
52         goptions gsfname=graphout gsfmode=replace device=gif;
53         
54         proc gplot data=freq03;
55         plot percent * yq = finalrating / grid  ;
56         run;

NOTE:  101 records written to \\sassrvr\shared\users\steve\BRS\brs_m29.gif
57         quit;

 

 

 

 

   

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 1919 views
  • 0 likes
  • 3 in conversation