Tips Talk:Using GETOPTION to Save and Restore Options
Good tip Don. You beat me to it :)--Art Carpenter 02:53, 2 March 2009 (EST)
You might want to mention PROC OPTSAVE and PROC OPTLOAD, used when you want to save and then restore ALL of your settings. --Jack Hamilton
Good suggestion Jack. Have added that to the read more page. --Don Henderson 14:16, 5 March 2009 (EST)
looks ready to me --Statprof 08:50, 12 March 2009 (EDT)
features of the features in this tip
The main feature of this tip (beside the fact of %sysfunc() capability) is the GETOPTION() function. A handy feature of this function is the second parameter which is not demonstrated in this tip of the day, just defaulting to empty. It can take value KEYWORD. This parameter value becomes most useful when collecting to reuse, the value of an option that is not "boolean" (prefix with NO to switch it off) but like PAGESIZE or LINESIZE needs its keyword and '=' to set the value.
%let old_option = %sysfunc( getoption( pagesize )) ;
puts just a number into &old_option
%let old_option = %sysfunc( getoption( pagesize, keyword )) ;
puts into &old_option
or whatever the prevailing pagesize value is current.
--peterC 14:31, 4 August 2012 (EDT)