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

Hi everyone,

So, I have this dataset for differnet industries and different years. and I have this simple code to plot trends of industries:

proc gplot data=have;

plot var1*year;

by industry;

run;

I have 18 industries, so the output gives me 18 different graph sheets. Now, I want to write a code to take all of these to a picture. So I have added this code before running the plot:

filename output 'd:\myfile.gif';

goptions device=gif gsfname=output gsfmode=replace;

But, it gives me only one of the industries. My question is that, is there anyway to convert all of 18 graphs to 18 distinct pictures by a simple code?

I really appreciate your helps.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Doc_Duke
Rhodochrosite | Level 12

A couple of things.

PROC GREPLAY will allow you to combine the multiple plots.

If you have SAS 9.3 or later, the ODS graphics and the SG procedures have a lot of the combination tools built in.  Check out

http://blogs.sas.com/content/graphicallyspeaking/

for some examples.

View solution in original post

3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12

A couple of things.

PROC GREPLAY will allow you to combine the multiple plots.

If you have SAS 9.3 or later, the ODS graphics and the SG procedures have a lot of the combination tools built in.  Check out

http://blogs.sas.com/content/graphicallyspeaking/

for some examples.

Cynthia_sas
SAS Super FREQ

Hi, As Doc suggested, there are some very good examples on line. Here is a quick scatter plot that uses PROC SGPANEL to create a paneled plot. With only 3 values for CHOL_STATUS, the panel is small and "auto-arranged" but you can arrange the layout however you want (3 rows of 6 or 6 rows of 3) for your data. The doc shows how to get row-wise or column-wise panels.

Cynthia

ods _all_ close;

ods listing sge=off;

proc sgpanel data=sashelp.heart;

  panelby chol_status;

  scatter x=ageatdeath y=cholesterol;

run;

ballardw
Super User

I suspect if you are generating HTML output and pay attention to which folder that output goes to, you will find a plethora of PNG files (basically GIF equivalents) all sequentially numbered named gplot.png, gplot2.png, ...

If that location happens to be the temporary work library location don't expect them to survive as SAS shut down, but directing the HTML output to a specific location should let you control where to find them.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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