Sample 24946: Dynamically replay graphs to invidifual GIF files
/* Reset global statements and specify GIF device driver */
goptions reset=all dev=gif;
/* Delete entries in WORK.GSEG catalog */
proc greplay nofs igout=work.gseg;
delete _all_;
run;
options macrogen symbolgen mprint;
data one;
input rate time grp $;
datalines;
5 1 a
7 1 a
6 2 a
8 2 a
7 3 a
9 3 a
5 4 a
6 5 a
2 1 b
4 1 b
6 2 b
5 2 b
7 3 b
9 3 b
3 4 b
6 5 b
;
/* Turn DISPLAY off */
goptions nodisplay;
/* Create some graphs in the WORK.GSEG catalog */
proc shewhart graphics;
xrchart rate*time;
by grp;
run;
symbol1 v=star i=none c=blue;
proc gplot;
plot rate*time;
by grp;
run;
/* Use DSGI function NUMGRAPH to determine number of entries */
/* in WORK.GSEG catalog, Create macro variable that resolves */
/* to the total number of entries to be used as a loop counter */
/* in MACRO %DO loop. */
data _null_;
rc=gset('catalog','work','gseg');
rc=ginit();
call gask('numgraph',grsegcnt,rc);
call symput('grsegcnt',grsegcnt);
rc=gterm();
run;
/* Define macro to replay all entries in WORK.GSEG. */
/* Specify FILENAME and GOPTIONS to create GIF files. */
%macro grep;
%do i=1 %to &grsegcnt;
filename test&i "file&i..gif";
goptions display gsfname=test&i gsfmode=replace gsflen=80;
proc greplay nofs igout=work.gseg;
replay &i;
run;
quit;
filename test&i clear;
%end;
%mend grep;
/* Invoke macro */
%grep

This sample program dynamically replays all of the entries in a graphics catalog to individual GIF files.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> GREPLAY
|
| Date Modified: | 2005-09-01 03:03:08 |
| Date Created: | 2004-11-11 11:08:05 |
Operating System and Release Information
| SAS System | SAS/GRAPH | All | n/a | n/a |