It's pretty well known that disabling unnecessary output will speed up most SAS PROCs, in particular when processing large amounts of (by-grouped) data. My standard go-to inside a macro that *only* has to produce a dataset (no actual result output) besides targeted ODS EXCLUDE statements is to check SASHELP.VDEST for open destinations, turn those into macro variables and close them, and then re-open the closed destinations.
The one thing that still clutters up the SAS Foundation Results window is ODS output datasets, which when numbering in the tens of thousands can really slow things down. I can get rid of those with an ODS RESULTS OFF (or ODS NORESULTS), but ideally I'd like to restore settings to whatever they were before the call when finished - not forcing things back open if previously closed by the user. Is there any way to programmatically check the ODS RESULTS status like you can do for other destinations? In a similar vein, can this be done for ODS GRAPHICS, or the ODS EXCLUDE list?
Hello @pblls,
The status of ODS GRAPHICS (ON=1, OFF=0) is stored in the SYSODSGRAPHICS automatic macro variable.
ODS SELECT or EXCLUDE lists can be retrieved with the ODS SHOW statement. It writes to the log, which can be read programmatically (cf. Re: Macro Variable for SAS/STAT version?).
I don't know a solution for the ODS RESULTS status. The 2016 post Re: Catch current setting of "ods escapechar" suggests that there was no simple solution back then. However, things might have changed. In particular, now there is the SYSODSESCAPECHAR automatic macro variable, which contains the current setting of ODS ESCAPECHAR.
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 16. 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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: