Occasionally you might want to suspend output generation to a destination. You don't want to close it per se; you simply want to disable it for a while, then re-enable it. Closing the destination may not work anyway. (HTML can be closed and reopened with careful use of NO_BOTTOM_MATTER, NO_TOP_MATTER and file appending, but you're out of luck with PDF, for example.) What to do?
To suspend output, you can use the ODS SELECT/EXCLUDE statement. Imagine that you have an ODS HTML destination open. To suspend it, just say:
ods html select none;
or:
ods html exclude all;
When you're ready to resume ODS HTML output, say:
ods html select all;
or:
ods html exclude none;
-- David Kelley, SAS
For a longer explanation of ODS CLOSE, see "What is the best way to suppress ODS output in SAS?" The article also describes the use of the NOPRINT option, which is available in some of the old SAS procedures.
For programmers who might be tempted to use ODS _ALL_ CLOSE instead, don't do it. ODS CLOSE has several advantages, which you can read about in the article "Five reasons to use ODS EXCLUDE to suppress SAS output."
For a longer explanation of ODS CLOSE, see "What is the best way to suppress ODS output in SAS?" The article also describes the use of the NOPRINT option, which is available in some of the old SAS procedures.
For programmers who might be tempted to use ODS _ALL_ CLOSE instead, don't do it. ODS CLOSE has several advantages, which you can read about in the article "Five reasons to use ODS EXCLUDE to suppress SAS output."
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.