Category: | Special |
SAS options that are passwords, such as EMAILPW and METAPASS,
return the value xxxxxxxx
, and not the actual
password.
EXPAND is valid only for character system option values. EXPAND is ignored if option-name has an option type of Boolean, such as CENTER or NOCENTER, or if the value of the option is numeric.
Expansion: Environment variables, within the option value, are not expanded
KEYWORD is valid only for character or numeric system option values. KEYWORD is ignored for system options whose option type is Boolean, such as CENTER or NOCENTER. SAS issues an error message when the KEYWORD option is specified and option-name is a graphics option.
/* Save the value of the YEARCUTOFF system option */ %let cutoff=%sysfunc(getoption(yearcutoff,keyword)); data ages; if getoption('yearcutoff') = '1920' then do; ...more SAS statements... end; else do; ...more SAS statements... /* Reset YEARCUTOFF */ options &cutoff; end; run;
%macro showopts; %put MAPS= %sysfunc( getoption(MAPS)); %put MAPSEXPANDED= %sysfunc( getoption(MAPS, EXPAND)); %put PAGESIZE= %sysfunc( getoption(PAGESIZE)); %put PAGESIZESETBY= %sysfunc( getoption(PAGESIZE, HOWSET)); %put PAGESIZESCOPE= %sysfunc( getoption(PAGESIZE, HOWSCOPE)); %put PS= %sysfunc( getoption(PS)); %put LS= %sysfunc( getoption(LS)); %put PS(keyword form)= %sysfunc( getoption(PS,keyword)); %put LS(keyword form)= %sysfunc( getoption(LS,keyword)); %put FORMCHAR= %sysfunc( getoption(FORMCHAR)); %put HSIZE= %sysfunc( getoption(HSIZE)); %put VSIZE= %sysfunc( getoption(VSIZE)); %put HSIZE(in/keyword form)= %sysfunc( getoption(HSIZE,in,keyword)); %put HSIZE(cm/keyword form)= %sysfunc( getoption(HSIZE,cm,keyword)); %put VSIZE(in/keyword form)= %sysfunc( getoption(VSIZE,in,keyword)); %put HSIZE(cm/keyword form)= %sysfunc( getoption(VSIZE,cm,keyword)); %mend; goptions VSIZE=8.5 in HSIZE=11 in; options PAGESIZE=67; %showopts
NOTE: PROCEDURE PRINTTO used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 6 %macro showopts; 7 %put MAPS= %sysfunc( 8 getoption(MAPS)); 9 %put MAPSEXPANDED= %sysfunc( 10 getoption(MAPS, EXPAND)); 11 %put PAGESIZE= %sysfunc( 12 getoption(PAGESIZE)); 13 %put PAGESIZESETBY= %sysfunc( 14 getoption(PAGESIZE, HOWSET)); 15 %put PAGESIZESCOPE= %sysfunc( 16 getoption(PAGESIZE, HOWSCOPE)); 17 %put PS= %sysfunc( 18 getoption(PS)); 19 %put LS= %sysfunc( 20 getoption(LS)); 21 %put PS(keyword form)= %sysfunc( 22 getoption(PS,keyword)); 23 %put LS(keyword form)= %sysfunc( 24 getoption(LS,keyword)); 25 %put FORMCHAR= %sysfunc( 26 getoption(FORMCHAR)); 27 %put HSIZE= %sysfunc( 28 getoption(HSIZE)); 29 %put VSIZE= %sysfunc( 30 getoption(VSIZE)); 31 %put HSIZE(in/keyword form)= %sysfunc( 32 getoption(HSIZE,in,keyword)); 33 %put HSIZE(cm/keyword form)= %sysfunc( 34 getoption(HSIZE,cm,keyword)); 35 %put VSIZE(in/keyword form)= %sysfunc( 36 getoption(VSIZE,in,keyword)); 37 %put HSIZE(cm/keyword form)= %sysfunc( 38 getoption(VSIZE,cm,keyword)); 39 %mend; 40 goptions VSIZE=8.5 in HSIZE=11 in; 41 options PAGESIZE=67; 42 %showopts MAPS= ("!sasroot\maps-path\en\maps") MAPSEXPANDED= ("C:\maps-path\en\maps") PAGESIZE= 67 PAGESIZESETBY= Options Statement PAGESIZESCOPE= Line Mode Process PS= 67 LS= 78 PS(keyword form)= PS=67 LS(keyword form)= LS=78 FORMCHAR= ‚ƒ„…†‡ˆ‰Š‹Œ+=|-/\<>* HSIZE= 11.0000 in VSIZE= 8.5000 in HSIZE(in/keyword form)= HSIZE=11.0000 in HSIZE(cm/keyword form)= HSIZE=27.9400 cm VSIZE(in/keyword form)= VSIZE=8.5000 in HSIZE(cm/keyword form)= VSIZE=21.5900 cm 43 proc printto; run;
/* Check the value of papersize before we change it. */ /* The initial value is A4 as this value was used when */ /* SAS started. */ %put %sysfunc(getoption(papersize,keyword)); /* Change the PAPERSIZE value and check the change. */ options papersize="600x800 Pixels"; %put %sysfunc(getoption(papersize,keyword)); /* Change PAPERSIZE back to the default value and check it. */ /* RESULT: LETTER */ %let defsize = %sysfunc(getoption(papersize,keyword,defaultvalue)) ; options &defsize; run; %put %sysfunc(getoption(papersize,keyword)); /* Change the value to the startup value and check it. */ /* RESULT: A4 */ %let defsize = %sysfunc(getoption(papersize,keyword,startupvalue)) ; options &defsize; run; %put %sysfunc(getoption(papersize,keyword));
22 /* Check the value of papersize before we change it. */ 23 /* The initial value is A4 as this value was used when */ 24 /* SAS started. */ 25 26 %put %sysfunc(getoption(papersize,keyword)); PAPERSIZE=A4 27 28 /* Change the PAPERSIZE value and check the change. */ 29 30 options papersize="600x800 Pixels"; 31 32 %put %sysfunc(getoption(papersize,keyword)); PAPERSIZE=600X800 PIXELS 33 34 /* Change PAPERSIZE back to the default value and check it. */ 35 /* RESULT: LETTER */ 36 37 %let defsize = %sysfunc(getoption(papersize,keyword,defaultvalue)) ; 38 options &defsize; run; 39 %put %sysfunc(getoption(papersize,keyword)); PAPERSIZE=LETTER 40 41 /* Change the value to the startup value and check it. */ 42 /* RESULT: A4 */ 43 44 %let defsize = %sysfunc(getoption(papersize,keyword,startupvalue)) ; 45 options &defsize; run; 46 %put %sysfunc(getoption(papersize,keyword)); PAPERSIZE=A4