Even though this sample program creates a total of ten graphs, only the seventh graph the code creates will display when you click the Results tab for this sample.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Even though this sample program creates a total of ten graphs, only the seventh graph the code creates will display when you click the Results tab for this sample.
The graphics output in the Results tab was produced using SASĀ® 9.2. Submitting the sample code with releases of SAS prior to SAS 9.2 might produce different results.
/* Delete all of the old graphs from */
/* the WORK.GSEG catalog if necessary. */
proc greplay nofs igout=work.gseg;
delete _all_;
run;
quit;
/* Create a sample data set */
data one;
input State $ Num Region $;
datalines;
NY 10 North
NJ 15 North
GA 10 South
AL 15 South
CA 10 West
WA 15 West
;
run;
/* Set the graphics environment */
goptions reset=all cback=white border htitle=12pt htext=10pt;
goptions device=gif nodisplay xpixels=600 ypixels=400;
/* Create some sample GSLIDE entries */
proc gslide;
title1 'Test 1';
run;
title1 'Test 2';
run;
title1 'Test 3';
run;
title1 'Test 4';
run;
quit;
/* Reset the TITLE statement */
title1;
/* Create some sample GCHART entries */
proc gchart;
vbar state/ sumvar=num patternid=midpoint
width=12 raxis=axis1;
axis1 minor=none;
footnote1 h=2 ' ';
by region;
run;
quit;
/* Create some sample GPLOT entries */
proc gplot;
plot num*state;
by region;
symbol1 v=dot c=vibg h=1.3;
footnote1 h=2 ' ';
run;
quit;
/* Use DSGI function NUMGRAPH to determine the number of entries in */
/* GSEG catalog. Create a macro variable that resolves to that value. */
data _null_;
rc=gset('catalog','work','gseg');
rc=ginit();
call gask('numgraph',grsegcnt,rc);
call symput('grsegcnt',grsegcnt);
rc=gterm();
run;
/* Create entries that contain page numbers */
%macro page;
%do i= 1 %to &grsegcnt;
proc gslide;
footnote1 j=r "Page &i ";
footnote2 ' ';
run;
quit;
%end;
%mend page;
/* Invoke the PAGE macro */
%page
/* Use GREPLAY with a two panel template, to replay the original */
/* GRSEG entry and the GRSEG entry containing the page number. */
%macro grep;
%do i=1 %to &grsegcnt;
proc greplay nofs igout=work.gseg tc=tempcat;
tdef spectwo des='two panel template'
1/ llx= 0 lly=0
ulx= 0 uly=100
urx= 100 ury=100
lrx= 100 lry=0
color=white
2/ llx=0 lly=0
ulx=0 uly=100
urx=100 ury=100
lrx=100 lry=0
color=white
;
template spectwo;
treplay 1:&i 2:%eval(&i+&grsegcnt);
run;
quit;
%end;
%mend grep;
goptions reset=all device=gif
gsfname=grafout gsfmode=replace
xpixels=600 ypixels=400;
filename grafout 'c:\temp';
/* Invoke the GREP macro */
%grep
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> GREPLAY |
Date Modified: | 2005-09-01 03:03:07 |
Date Created: | 2004-11-11 11:08:04 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | All | n/a | n/a |