The sample code on the Full Code tab first uses multiple PROC GCHART steps to write multiple graphs to the default graphics catalog of WORK.GSEG. The DESCRIPTION= option is used in each VBAR statement to modify the description of each graph.
In the final step in the code, a single PROC GREPLAY step is used to replay all of the graphs in the WORK.GSEG catalog to the PDF file. The sample code uses the ODS PROCLABEL statement before the PROC GREPLAY step to modify the procedure description that appears at the top of the table of contents.
Note that this technique can also be used when using SAS/GRAPH with the ODS HTML statement when using the BODY=, FRAME=, and CONTENTS= options.
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.
%macro delcat(catname);
%if %sysfunc(cexist(&catname)) %then %do;
proc greplay nofs igout=&catname;
delete _all_;
run;
quit;
%end;
%mend delcat;
%delcat(work.gseg)
options nodate;
/* Use the NODISPLAY option when writing */
/* the original graphs to the default */
/* graph catalog of WORK.GSEG. */
goptions reset=all device=sasprtc nodisplay
htitle=13pt htext=11pt;
title1 'Average Weight for Females';
axis1 minor=none;
proc gchart data=sashelp.class;
where sex="F";
vbar age / sumvar=weight type=mean subgroup=age
nolegend discrete width=8
raxis=axis1
description='Average Weight for Females';
run;
quit;
title1 'Average Weight for Males';
axis1 minor=none;
proc gchart data=sashelp.class;
where sex="M";
vbar age / sumvar=weight type=mean subgroup=age
nolegend discrete width=8
raxis=axis1
description='Average Weight for Males';
run;
quit;
title1 'Average Height for Females';
axis1 minor=none;
proc gchart data=sashelp.class;
where sex="F";
vbar age / sumvar=height type=mean subgroup=age
nolegend discrete width=8
raxis=axis1
description='Average Height for Females';
run;
quit;
title1 'Average Height for Males';
axis1 minor=none;
proc gchart data=sashelp.class;
where sex="M";
vbar age / sumvar=height type=mean subgroup=age
nolegend discrete width=8
raxis=axis1
description='Average Height for Males';
run;
quit;
/* Turn the DISPLAY option back on to create */
/* the PDF output. */
goptions display;
ods _all_ close;
ods pdf file='sastest.pdf';
ods proclabel="Simplified Table of Contents";
proc greplay igout=work.gseg nofs;
replay _all_;
run;
quit;
ods _all_ close;
ods listing;
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.
This sample code creates PDF output. Click here to view the PDF output.
Type: | Sample |
Date Modified: | 2012-12-07 15:39:31 |
Date Created: | 2012-11-28 10:22:17 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | SAS/GRAPH | z/OS | 9.1 TS1M3 SP4 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |||
Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |||
Windows Vista | 9.1 TS1M3 SP4 | |||
Windows Vista for x64 | 9.1 TS1M3 SP4 | |||
64-bit Enabled AIX | 9.1 TS1M3 SP4 | |||
64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |||
64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |||
HP-UX IPF | 9.1 TS1M3 SP4 | |||
Linux | 9.1 TS1M3 SP4 | |||
Linux on Itanium | 9.1 TS1M3 SP4 | |||
OpenVMS Alpha | 9.1 TS1M3 SP4 | |||
Solaris for x64 | 9.1 TS1M3 SP4 | |||
Tru64 UNIX | 9.1 TS1M3 SP4 |