|SAS Companion for the OpenVMS Operating Environment|
No matter which mode of operation you use for running SAS, you may want to customize certain aspects of the SAS System. For example, you may want to change the line size or page size for your output, or you may want to see performance statistics for your SAS programs.
Under OpenVMS, you can customize the SAS System for your session in the following ways:
Note: For information about customizing your SAS windowing
environment, see Customizing the SAS Windowing Environment.
|Specifying System Options in the SAS Command|
The way you specify the SAS command determines the mode of operation that you use for running SAS as well as the default SAS system options. The general form of the SAS command is
|$ SAS8/system-option-list filename|
Both system-option-list and file-specification are optional. You can include system-option-list for any mode of operation. If you include file-specification, then SAS is invoked in noninteractive mode. If you do not include file-specification, then the mode of operation will be the SAS windowing environment. For details about invoking SAS in the different modes of operation, see Introduction.
All SAS system options can be specified in the SAS command. Under OpenVMS, each option is preceded by a forward slash (/).
In the following example, the LINESIZE= system option tells SAS to use a line length of 80 characters for the log file, the procedure output file, and the print file:
$ SAS8/LINESIZE=80/PRINT=SYS$LOGIN:TEST.OUTThe PRINT= system option tells SAS to route the procedure output to the file SYS$LOGIN:TEST.OUT.
The next example invokes SAS in noninteractive mode, specifying the program file MYPROG and the LINESIZE= and PAGESIZE= system options:
$ SAS8/LINESIZE=60/PAGESIZE=80 MYPROG
As the examples show, system options that take a value (such as LINESIZE= and PRINT=) are specified in the following form:
Note: Any option value that
is entered on the OpenVMS command line
within single quotation marks (') is resolved to its symbol value before it
is processed by the SAS System. Any quoted value that should not be resolved
as a symbol must be enclosed in double quotation marks ("). For example,
the values for the system options FMTSEARCH=, INITSTMT=, and SYSPARM= must
be enclosed in double quotation marks.
Other system options can be thought of as on (enabled) or off (disabled). Specifying just the keyword enables the option; specifying the keyword with the prefix NO disables the option. In the following example, the CENTER and STIMER system options are disabled:
If no system options are specified in the SAS command, a configuration file, or an autoexec file, then the default system options that are shipped with the SAS System are in effect. However, your system manager may have overridden those default options. Ask your system manager for details about the default system options at your site.
For more information about SAS system options, see System Options and SAS Language Reference: Dictionary.
A SAS configuration file contains SAS system options that are set automatically when you invoke SAS. Configuration files can contain only SAS system option settings and are processed before the SAS System initializes.
For Version 8, the configuration file is typically named SASV8.CFG. This file typically resides in your home directory.
Under OpenVMS, the OpenVMS logical name SAS$CONFIG is used to refer to SAS configuration files. This logical name can exist in one or more of the process-, job-, group-, or system-level logical name tables. Therefore, four types of configuration files can be created:
Ask your system manager which of these configuration
files are used at your site.
To create a configuration file, follow these steps:
/SASUSER=DISK:[JQK.SASUSER]/WORK=[JQK.SASWORK] /DMS/LINESIZE=80/PAGESIZE=60 /FULLSTIMER
Note: You cannot include comment lines in a configuration
$ DEFINE SAS$CONFIG- _$ DISK:[DIRECTORY]MYCONFIG.CFG
For more information about creating logical names, see OpenVMS User's Manual.
If you have created the OpenVMS logical name SAS$CONFIG, then SAS automatically executes the configuration file that is associated with that logical name. If SAS$CONFIG exists in more than one logical name table, then SAS executes the configuration files in the order in which they are listed in Precedence for System Option Specifications.
Alternatively, you can use the CONFIG= system option in the SAS command to tell SAS where to find your configuration file. For example, the following SAS command invokes SAS and tells it to use the process-level configuration file MYCONFIG.CFG:
When you invoke SAS, you can use the VERBOSE system option to write the contents of all configuration files to your OpenVMS display as the SAS System initializes.
For example, suppose your site has a system-level configuration file (defined by the logical name SAS$CONFIG in your system-level logical name table) that contains the following system options:
Suppose that you have also created your own configuration file, MYCONFIG.CFG, and that it contains the following options:
Now suppose you use the following command to invoke SAS:
The contents of both the system-level configuration file and MYCONFIG.CFG are written to your OpenVMS display, as follows:
The /VERBOSE option was specified. SYSTEM SAS$CONFIG file /LINESIZE=80/PAGESIZE=60 PROCESS SAS$CONFIG or /CONFIG= file /FULLSTIMER
Unlike configuration files, which can contain SAS system options, an autoexec file can contain valid SAS statements. Autoexec files are processed immediately after the SAS System initializes but before it processes any source statements.
For Version 8, the autoexec file is named AUTOEXEC.SAS. This file typically resides in your home directory.
For example, an autoexec file could contain the following lines:
options fullstimer linesize=75; libname mylib 'dev:[homedir.subdir]'; dm 'wait 0';In this example, the OPTIONS statement sets some SAS system options, the LIBNAME statement assigns a libref, and the DM statement executes a SAS windowing environment command.
Note: Some SAS system options can be specified only
when you invoke the SAS System. These system options cannot be specified in
an OPTIONS statement; therefore, they cannot be specified in an autoexec file. Summary of SAS System Options under OpenVMS
tells where each SAS system option can be specified.
Because autoexec files are processed after SAS is initialized, setting the NODATE and LINESIZE= options in a configuration file affects the appearance of the SAS log header, whereas setting NODATE and LINESIZE= in an autoexec file does not. An OPTIONS statement in an autoexec file is equivalent to submitting an OPTIONS statement as the first statement of your SAS session.
Under OpenVMS, the OpenVMS logical name SAS$INIT is used to refer to SAS autoexec files. This logical name can exist in one or more of the process-, job-, group-, or system-level logical name tables. Therefore, four types of autoexec files can be created:
Ask your system manager which of these autoexec files
are used at your site.
To create an autoexec file, follow these steps:
$ DEFINE SAS$INIT- _$ DISK:[DIRECTORY]MYEXEC.SAS
For more information about creating logical names, see OpenVMS User's Manual.
If you have created the OpenVMS logical name SAS$INIT, then SAS automatically executes the statements in the autoexec file that is associated with that logical name. If SAS$INIT exists in more than one logical name table, then SAS executes the autoexec files in the order in which they are listed in Precedence for System Option Specifications.
Alternatively, you can use the AUTOEXEC= system option in the SAS command to tell SAS where to find your autoexec file. For example, the following SAS command invokes SAS and tells it to execute the autoexec file MYEXEC.SAS:
SAS statements that are submitted from an autoexec file usually are not displayed in the SAS log. However, if you specify the ECHOAUTO system option when you invoke SAS, then SAS writes (or "echoes") the autoexec statements to the SAS log as they are executed. For example, suppose your autoexec file is MYEXEC.SAS and that it contains the following SAS statements:
options fullstimer linesize=75; libname mylib 'dev:[homedir.subdir]'; dm 'wait 0';
If you use the following command to invoke SAS, then the contents of MYEXEC.SAS will be written to the SAS log.
For more information about the ECHOAUTO system option, see SAS Language Reference: Dictionary.
You can use the OPTIONS statement to specify system option settings at any time during a SAS session, except within data lines or parmcard lines. Settings remain in effect for the duration of the session or until you reset them with another OPTIONS statement.
Not all system options can be specified in an OPTIONS statement. The summary table of system options, Summary of SAS System Options, tells where each system option can be specified.
The following is an example of an OPTIONS statement:
options nodate linesize=72;
For more information about the OPTIONS statement, see SAS Language Reference: Dictionary.
|Displaying System Option Settings|
Most SAS system options are set to default values. To display
the current settings of SAS system options, use either the OPTIONS procedure,
the System Options window, or the GETOPTION function.
The OPTIONS procedure writes to the SAS log all system options that are available under OpenVMS. System Options describes the system options listed by the OPTIONS procedure that are host-specific and that have host-specific behavior. SAS Language Reference: Dictionary describes all system options that are completely portable (that is, those that have no host-specific behavior) and that are portable but may be specified differently in various operating environments.
By default, the procedure lists one option per line with a brief explanation of what the option does. To list the options with no explanation, use the LIST option:
proc options list; run;
For more information about the OPTIONS procedure, see
and SAS Language Reference: Dictionary.
The SAS System Options window displays the settings of the SAS system options. The system options are grouped by their function within the SAS System. Each group has at least one subgroup.
To display the System Options window, do one of the following:
optionson the command line of any SAS windowing environment window or windowing procedure window and press RETURN.
Options, and then select
You can also use the System Options window to change
the settings of system options for the duration of your SAS session. To change
the setting of a system option either double-click on the name of the system
option, or with cursor on the name of the system option press the right mouse
button and select
Modify Value. The Modify Value dialog box opens. You can then modify the setting
of the system option as desired. Click on [OK] to save your
changes. Click on [Cancel] to ignore any changes and close
the Modify Value dialog box.
You can close the System Options window by doing one of the following:
Closefrom the menu.
For help and additional information about the System Options window, click on [Help] in the window.
For additional information about system options settings,
see Summary of SAS System Options under OpenVMSand SAS Language Reference: Dictionary.
The GETOPTION function returns the value of a SAS system option or graphics option. It can be used within the DATA step or in conjunction with %SYSFUNC in open code. For additional details, see the GETOPTION function in SAS Language Reference: Dictionary.
|Precedence for System Option Specifications|
For many system options, different values may be specified in the SAS command, in a configuration file, in an OPTIONS statement (submitted in an autoexec file or in a SAS program), and in the System Options window. When the same system option is set in more than one place, the order of precedence is as follows:
In other words, the System Options window or OPTIONS statement takes precedence over autoexec files; autoexec files take precedence over the SAS command; the SAS command takes precedence over configuration files; and the configuration files take precedence over the VMS_SAS_OPTIONS DCL symbol.
|Precedence for Similar Types of Options|
Some SAS system options have the same effect (and usually the same name) as other types of options. For example, the BUFSIZE= system option is analogous to the BUFSIZE= data set option. Also, under OpenVMS, the CC= system option is analogous to the CC= external I/O statement option that is described in Host-Specific External I/O Statement Options in the FILENAME statement.
In the case of overlapping options, the SAS System uses the following rules of precedence:
The SAS System assigns a data library that has the libref SASUSER. The SASUSER library contains a SAS catalog that enables you to customize certain features of the SAS System while your SAS session is running and to save these changes. For example, in base SAS software, any saved changes that you make to function key settings or to window attributes are stored in a catalog named SASUSER.PROFILE. The SASUSER library can also contain personal catalogs for other SAS software products. You can also store SAS data files, SAS data views, SAS programs, and additional SAS catalogs in your SASUSER library.
In addition to storing function key settings and window attributes, the SASUSER.PROFILE catalog is used to store your DEFAULT.FORM. The DEFAULT.FORM is created by the FORM subsystem. It is used to control the default destination of all output that is generated by the PRINT command during a SAS windowing environment session. For information about the FORM subsystem, see Host-Specific Frames of the FORM Window and SAS Language Reference: Concepts.
Under OpenVMS, the system-level logical name SAS$USER specifies the location of the default SASUSER data library. This logical name is defined when SAS is installed and points to SYS$LOGIN, your default login directory.
This name defines the location of the default SASUSER
data library. For more information about how to change this library with the SASUSER= system
option, see SASUSER=.
By creating your own SASUSER libraries, you can customize the SAS System to meet the requirements of a number of different types of jobs. For example, suppose you want to create a user profile for a particular type of task that requires a unique set of key definitions.
To tell SAS which library to use as your SASUSER library, use the SASUSER= system option when you invoke SAS. For example, if you want to designate a directory named MYSUSER as your SASUSER library, you would use the following command:
Any profile changes that you make during your session are saved in the SAS catalog SASUSER.PROFILE, which is a file in the MYSUSER directory. These changes will be retained when you end your SAS session.
|OpenVMS Logical Names That SAS Uses|
A command procedure file that is loaded by the SAS installation procedure defines many logical names that affect certain aspects of SAS programs or SAS sessions. Most of these logical names are of interest only to system administrators. A command procedure file (SAS8_SYSTEM.COM) defines these same logical names at the system level. System administrators can see Installation Instructions and System Manager's Guide: The SAS System under OpenVMS Alpha and VAX, Version 8 for details and can redefine these logical names if necessary.
Note: The installation procedure provides two command
procedure files, SAS8.COM and SAS8_SYSTEM.COM. The SAS8.COM file
defines process-level logical names. The SAS8_SYSTEM.COM file
defines system-level logical names.
You can also customize your SAS sessions by defining some of the logical names at the process or job level. (When a logical name is defined at both the system level and the job level, the job-level definition takes precedence.) In addition, some logical names that are not defined by the SAS8.COM or SAS8_SYSTEM.COM file at the system or process level can be defined by individual users at the process or job level (for example, SAS$CONFIG).
|System-Level Logical Names That You Can Override|
The following logical names are defined by the SAS8.COM or SAS8_SYSTEM.COM files during installation of the SAS System, but you can redefine them at the process or job level:
you define an OpenVMS search-list
logical name to reference a list of directories, and then use the DCL command
SET DEFAULT to change your default directory location to that logical name,
you cannot invoke the SAS System. When you use the SET DEFAULT command, it
modifies the SYS$DISK logical name
to reference the new location. SYS$DISK is
used in the definition of the SAS$LIBRARY logical
name. The SAS System is unable to locate the files that it requires when SAS$LIBRARY and SYS$DISK are
defined in this way. If you must set your default directory to an area that
is defined by a search-list logical name, then remove references to SYS$DISK in
all logical names that begin with SAS$.
|Other Logical Names That You Can Define|
The following logical names are not defined by the SAS8.COM or SAS8_SYSTEM.COM file during installation, but you may want to define them at the process level as a way of customizing certain aspects of your SAS sessions:
The following program uses the GETLOG function to determine whether the X statement executed properly. If the X statement did execute properly, then the program continues; if it did not, then the program stops.
x 'create/dir [sasxyz.newdir]'; data _null_; x=getlog('sas$x_status'); if x^="1" then do; put 'The directory was not created.'; put 'The OpenVMS return code was: ' x; put 'Program stopping.'; abort return; end; else put 'Directory was created successfully.'; run; libname mylib '[sasxyz.newdir]'; data mylib.test; input revenue expenses; profit=revenue-expenses; datalines; 39800.73 35678.93 28900.38 28456.99 40933.22 5683.33 ;
Note: The ABORT RETURN statement not only stops the
program, but also ends your SAS session.
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.