Proc Option Groups

From sasCommunity
Jump to: navigation, search

PROC OPTIONS will display SAS system option names and values. The GROUP= option confines the output to a single option group. The syntax is

Proc Options group = <GroupName>;
run;

For example, running

Proc Options group = help;
run;

will give output like this:

    SAS (r) Proprietary Software Release 9.2  TS1M0

 HELPENCMD         Use the English index to resolve command line help requests
 HELPINDEX=(/help/common.hlp/index.txt /help/common.hlp/keywords.htm common.hhk)
                   Location of help index files
 HELPTOC=(/help/helpnav.hlp/navigation.xml /help/common.hlp/toc.htm common.hhc)
                   Location of the help table of contents files
 HELPREGISTER=     Specifies the help file launched from SAS AWS->HELP menu.
 HELPLOC=("!MYSASFILES\classdoc" "!sasroot\nls\en\help" "!sasroot\core\help")
                   Location of help environment text and index files

Q: How do I get such output for all Options Groups without hard-coding the group names one at a time?

A: Get the group names from DICTIONARY.OPTIONS. Here's one way:

Proc SQL noprint; 
%Let List = *no rows selected;
select distinct cats('%Put Group: '
                    , group
                    ,';Proc Options group = '
                    , group
                    ,';run;')
         into   :List separated by ' '
         from    Dictionary.Options;
         quit;
&List.;
%symdel list;

The %LET statement really is not needed here. However, if you include a WHERE clause and no options meet the specified condition(s), it provides a message.

Of course, if you are using SQL to process DICTIONARY.OPTIONS, you can let SQL do all the work and not use PROC OPTIONS at all. The code for that is along these lines:

proc sql; select group, optname, optdesc
           from  dictionary.options
           order by group, optname;
          quit;