Chapter Contents |
Previous |
Next |
GETOPTION |
Category: | Special |
Syntax | |
Arguments | |
Examples |
Syntax |
GETOPTION(option-name<,reporting-options<,...>>) |
Note: | Do not put an equal sign after the name. For example, write PAGESIZE= as PAGESIZE. |
IN | reports graphic units of measure in inches. |
CM | reports graphic units of measure in centimeters. |
KEYWORD | returns option values in a KEYWORD= format that would be suitable for direct use in the SAS OPTIONS or GOPTIONS global statements. |
Examples |
%let cutoff=%sysfunc(getoption (yearcutoff,keyword)); options yearcutoff=1920; data ages; if getoption('yearcutoff') = '1920' then do; ...more statements... end; else put 'Set Option YEARCUTOFF to 1920'; run; options &cutoff;
%macro showopts; %put PAGESIZE= %sysfunc( getoption(PAGESIZE)); %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; %showopts;
The following is SAS output from the example.
PAGESIZE= 23 PS= 23 LS= 76 PS(keyword form)= PS=23 LS(keyword form)= LS=76 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.
Note: The default settings for pagesize and linesize
depend on the mode you use to run SAS.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.