I want to ouput a pair of charts created in proc gchart but I want to output them on the same page and am using proc greplay to do so. I only want to output from the greplay procedure and not the gcharts so I want them to be ignored by ODS. I think I have seen somewhere that ODS output can be stopped temporarily by using something like ODS PDF STOP; and then continued.
If you want to stick to your idea of "pausing" ODS (although I agree with Cynthia's point of view), you can do something like :
ODS PDF EXCLUDE yourGraphName(s) ;
This will prevent your charts from being displayed in the PDF document. The names are those that you will mention in the Greplay procedure (Gchart and Gchart1 in Cynthia's example) ; if there are several, list them space-separated.
To resume normal display, just submit :
ODS PDF SELECT ALL ;
This will reset the ODS PDF "black list" of things not to include. This works for each and every object sent through ODS, and for all ODS destinations except ODS OUTPUT.
This is strange because I've tested the ODS EXCLUDE statement on a GCHART procedure before sending my post ; and it worked perfectly alright.
I've just checked again, to be sure, and still no error (on both 8.2 and 9.1.3 SP4).
If you would post your sample code, then I'll have something to try and if my session crashes again, I can give Tech Support something to start with.
(or if you prefer, you can email it to me at email@example.com)
Cynthia, can you please try this code ? It works perfectly on my computer...
ODS PDF FILE = "c:\temp\test.pdf" ;
ODS PDF EXCLUDE gchart gchart1 ;
PROC GCHART DATA = sashelp.class ;
VBAR sex ;
HBAR age / DISCRETE ;
ODS PDF SELECT ALL ;
PROC PRINT DATA = sashelp.class ;
PROC GREPLAY NOFS TC=sashelp.templt IGOUT=work.gseg;
TEMPLATE = H2 ;
TREPLAY 1:gchart 2:gchart1 ;
RUN ; QUIT ;
ODS PDF CLOSE ;
Yes, your code is almost exactly what I'd tried. And this time it does works for me. I am no longer getting the error message that I got before, BUT, every time I run the test, SAS pops a PRINTING window that says: [pre]
SAS Graph Generic Driver to
HP LaserJet 5/5M PostScript
...and my only choice on that window is to hit CANCEL in which case, a blank page ejects from my printer.
So my weekend reboot (or something) seems to have fixed the cryptic error message. But, in the face of the generic printing window, I think I'd just move the SAS/Graph creation code outside of the ODS PDF "sandwich".
With regards the "stopping" of ODS for graphs, depending on your requirements, don't forget GOPTIONS DISPLAY/NODISPLAY. Code GOPTIONS NODISPLAY before your PROC GCHART (or whatever), then code GOPTIONS DISPLAY before PROC GREPLAY.