The SAS Output Delivery System and reporting techniques

ODS Graphics and proc greplay

Reply
Contributor
Posts: 34

ODS Graphics and proc greplay

Hi all

Is it possible to use proc greplay with graphs created with ods graphics? The graphs created by ods graphics is png format, and I can´t figure out how to refter to them in my proc greplay.

Tks for advice
Best regards
Jenny
SAS Super FREQ
Posts: 8,866

Re: ODS Graphics and proc greplay

Hi,
ODS Graphics cannot be used with Proc Greplay because it does not create a gseg catalog entry. So you may have to investigate Proc Sgplot and Proc Sgpanel, instead of greplay.
Cynthia
Contributor
Posts: 34

Re: ODS Graphics and proc greplay

Posted in reply to Cynthia_sas
Thanks for the hint. I´ll do that


Jenny
SAS Super FREQ
Posts: 8,866

Re: ODS Graphics and proc greplay

Hi:
I was away from my computer when I did my first post. Here are a couple of SGPANEL examples to get you started. And some links to the documentation and some papers to investigate:
http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/sgpanel-ov.htm
http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/sgplot-ov.htm
http://support.sas.com/resources/papers/proceedings09/158-2009.pdf
http://support.sas.com/resources/papers/proceedings09/174-2009.pdf
http://www2.sas.com/proceedings/forum2008/255-2008.pdf
http://www2.sas.com/proceedings/forum2007/193-2007.pdf
http://support.sas.com/resources/papers/proceedings09/324-2009.pdf


cynthia
[pre]
ods listing close;
ods html path='.' (url=none)
gpath='.' (url=none)
file='panel_loess.html'
style=ocean;

proc sgpanel data=sashelp.heart;
title '1) SGPANEL and LOESS statement';
panelby sex;
loess x=ageatdeath y=agechddiag /
clm alpha=.1;
run;
ods html close;


ods html path='.' (url=none)
gpath='.' (url=none)
file='panel_hbox.html'
style=ocean;

proc sgpanel data=sashelp.heart;
title '2) SGPANEL and HBOX statement';
panelby sex;
hbox ageatdeath / category=chol_status;
run;
ods html close;
[/pre]
SAS Super FREQ
Posts: 939

Re: ODS Graphics and proc greplay

If you want to put together heterogenous graphs (e.g. a bar chart and a box plot), I discuss a technique for doing this at the end of my "Secrets of the SGProcedures" paper (http://support.sas.com/resources/papers/proceedings09/324-2009.pdf). Take a look at that infomation and see if it helps.
Contributor
Posts: 34

Re: ODS Graphics and proc greplay

I want to put together two boxplots in one panel. I tried with the transparency, and got an error: ERROR: Box plots may not be overlaid.

ods html path='.' (url=none)
gpath='.' (url=none)
file='boxes.html'
style=ocean;
proc sgplot data=sashelp.class
tmplout="temp2.sas";
vbox height / category=age;
vbox weight / category=age transparency=0.3;
run;
ods html close;
SAS Super FREQ
Posts: 939

Re: ODS Graphics and proc greplay

The SG procedures currently do not allow boxplot overlays; however, you can do this in gtl. Run this programs and see if this is what you want:

proc template;
define statgraph boxplot;
begingraph;
layout overlay / cycleattrs=true;
BoxPlot X=Age Y=Height / LegendLabel="Height" datatransparency=0.5 name="a";
BoxPlot X=Age Y=Weight / LegendLabel="Weight" datatransparency=0.5 name="b";
discretelegend "a" "b";
endlayout;
endgraph;
end;
run;

proc sgrender data=sashelp.class template=boxplot; run;
Contributor
Posts: 34

Re: ODS Graphics and proc greplay

This is perfect, I added the orient=horizontal, so now I am very satisfied.

Do you know if it´s possible to control the position of the boxes, so that they don´t overlap. Here is one example of the graph I am thinking of:
http://www.stata.com/support/faqs/graphics/gph/graphdocs/box5.html

Thank you very much.

Best regards
Jenny Message was edited by: Jennys
N/A
Posts: 1

Re: ODS Graphics and proc greplay

Can I use the proc template in SAS 9.2 TS level1M0. Thanks
Super Contributor
Super Contributor
Posts: 3,174

Re: ODS Graphics and proc greplay

Posted in reply to everglades
To the OP: yours is a new query, suggest you not piggy-back on a query that was authored by someone else -- consider though adding a link in your forum post as an alternative to highlight relative content.

Also, your choice of forum is something else to consider next time - SAS/Graph has its own forum.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 9 replies
  • 876 views
  • 0 likes
  • 5 in conversation