Prevent the Results Viewer from opening automatically when generating output from ODS


Preventing the Results Viewer from opening automatically is one of the many functions that the ODS Preferences control. To prevent your CSV, HTML, RTF, PDF, or XLS output from displaying automatically in the Results Viewer, you can change the Preferences by choosing the following:

Tools ► Options ► Preferences ► Results

Under Results Options, clear the "View Results as they are generated" option.

To programatically make this change, use PROC REGISTRY. The sample code below saves the keys settings to a file with the DATA step then uses PROC REGISTRY to import the keys settings. Subsequent ODS destination statements generate output, but it will not be displayed automatically in the Results Viewer.

filename source 'temp.sasxreg';

data _null_;

file source;

put '[ODS\GUI\RESULTS]';

put ' "Auto Navigate" = "Off"';

run;

/*---------------------------*/

/* Change the SAS registry */

/*---------------------------*/

proc registry import=source;

run;

/*-------------------------------------------------*/

/* Notify an existing destination that */

/* it needs to reprocess the preferences. */

/*-------------------------------------------------*/

ods preferences;

The following statement also prevents the Results Viewer from displaying output immediately after it is created. However, it prevents any procedure or DATA step nodes from being created in the Results Window:

ods noresults;