The SAS Output Delivery System and reporting techniques

Pausing ODS Output

Reply
N/A
Posts: 0

Pausing ODS Output

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.

Does anyone know how this can be done?

Thanks,
SAS Super FREQ
Posts: 8,866

Re: Pausing ODS Output

Posted in reply to deleted_user
Hi,
Rather than "pause" ODS, I suggest taking a different approach:
[pre]

** 1st SAS/Graph pgm for chart (outside ODS "sandwich");
** 2nd SAS/Graph pgm for chart (outside ODS "sandwich");

ods pdf file='somefile.pdf';
proc greplay igout=work.gseg
tc=sashelp.templt template=v2s nofs;
treplay 1:gchart 2:gchart1;
run;
quit;
ods pdf close;

[/pre]

Basically, make sure that ONLY the GREPLAY step is inside the ODS "sandwich" for ODS PDF.
So you'd create all your graphs first in the work.gseg catalog and then do the greplay.

When replaying to PDF or sending graph output to PDF in general, you may find this Tech Support paper to be useful:
http://support.sas.com/techsup/technote/ts659/ts659.pdf

It discusses some techniques that you may find helpful including ODS-based approaches and GSFNAME approaches and ODS LAYOUT approaches.

Good luck,
cynthia
Super Contributor
Posts: 260

Re: Pausing ODS Output

Posted in reply to deleted_user
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.

Regards
Olivier
SAS Super FREQ
Posts: 8,866

Re: Pausing ODS Output

Hi:
This might work (using ODS PDF Exclude) IF the output object was coming from ODS GRAPHICS -- but I'm not sure that ODS PDF Exclude works for/with SAS/Graph output:
ODS PDF EXCLUDE GCHART;

I tried it in SAS and got an "An error has occurred during H method OM_C......"

cynthia
Super Contributor
Posts: 260

Re: Pausing ODS Output

Posted in reply to Cynthia_sas
Hi Cynthia.
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).

Weird message that you have, anyway ?!

Olivier
SAS Super FREQ
Posts: 8,866

Re: Pausing ODS Output

Olivier...
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.
Thanks, cynthia
(or if you prefer, you can email it to me at cynthia.zender@sas.com)
Super Contributor
Posts: 260

Re: Pausing ODS Output

Posted in reply to Cynthia_sas
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 ;
RUN ;
ODS PDF SELECT ALL ;
PROC PRINT DATA = sashelp.class ;
RUN ;
PROC GREPLAY NOFS TC=sashelp.templt IGOUT=work.gseg;
TEMPLATE = H2 ;
TREPLAY 1:gchart 2:gchart1 ;
RUN ; QUIT ;
ODS PDF CLOSE ;
SAS Super FREQ
Posts: 8,866

Re: Pausing ODS Output

Olivier:
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]
Now printing
SAS Graph Generic Driver to
HP LaserJet 5/5M PostScript
[/pre]
...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".

cynthia
N/A
Posts: 0

Re: Pausing ODS Output

Posted in reply to deleted_user
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.
Ask a Question
Discussion stats
  • 8 replies
  • 436 views
  • 0 likes
  • 3 in conversation