Tips:Explore config

From sasCommunity
Jump to: navigation, search

Some SAS sessions prepare the environment with unusual options. Sometimes I just want to know how it started. In recent releases, the GETOPTION() function reports CONFIG option value with the names of all the configuration files used in a way that is very suitable for a FILENAME statement. That makes it easy to report config file contents with code like what is shown at right.

filename cfg  %sysfunc( getoption( config )) ; 
data _null_;
  infile cfg;
  input;
  list; run;

This copies all the lines in all of the configuration files to the SAS log. The LIST statement wraps any long lines. Before the lines of each config file are the NOTEs defining what and where that file is located. Defining NO config option as I start SAS, it looks in the appropriate places and finds these files (here is the value returned by getoptions(config).

 ( "C:\Program Files\SASHome\x86\SASFoundation\9.3\sasv9.cfg"
   "C:\Program Files\SASHome\x86\SASFoundation\9.3\nls\en\sasv9.cfg"
   "D:\Peter\Documents\sasv9.cfg" 
   "D:\Peter\Documents\my sas files\sasv9.cfg" 
 )

See also: Configure Your Foundation SAS® Client Easily and without Risk

Submitted By peterC (talk)