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;
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.
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.
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;
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.