As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Tips:Using GETOPTION to Save and Restore Options

From sasCommunity
Revision as of 10:01, 26 July 2017 by Paulkaefer (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

You can use the GETOPTION function to query for the current value of an option. And if you wrap the call the GETOPTION function with the %SYSFUNC macro function, you can save the value in a macro variable to it can be easily restored. For example, the following will enable you to use NOCENTER NONUMBER NODATE for some output and then reset the values back to their original values:

%let saveOptions = 
       %sysfunc(getoption(CENTER)) %sysfunc(getoption(NUMBER)) %sysfunc(getoption(DATE));
options nocenter nonumber nodate;
/* your code that depends on these options */
options &saveOptions; /* reset options to original values */
Submitted By Don Henderson more