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?