Chapter Contents

Previous

Next
SAS Companion for the OpenVMS Operating Environment

Customizing Your SAS Session

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.  [cautionend]


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.OUT
The 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:

/option-name=value

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.  [cautionend]

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:

$ SAS8/NOCENTER/NOSTIMER

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.


Configuration Files

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.

Creating a Configuration File

To create a configuration file, follow these steps:

  1. Use any text editor to write SAS system options into an OpenVMS file. Use .CFG as the file type.

  2. Specify one or more system options in each line. A configuration file can contain any system option except the CONFIG= and VERBOSE options. (If either of these options appears in a configuration file, it is ignored; no error or warning message appears.) Use the same syntax that you would use for specifying system options with the SAS command (see Specifying System Options in the SAS Command)--except don't include the SAS command itself. For example, a configuration file might contain the following lines:
    /SASUSER=DISK:[JQK.SASUSER]/WORK=[JQK.SASWORK]
    /DMS/LINESIZE=80/PAGESIZE=60
    /FULLSTIMER

    Note:   You cannot include comment lines in a configuration file.  [cautionend]

  3. Close the new configuration file.

  4. Create the logical name SAS$CONFIG in the appropriate logical name table. For example, the following DEFINE DCL command creates the logical name SAS$CONFIG in the process-level logical name table.
    $ DEFINE SAS$CONFIG-
    _$ DISK:[DIRECTORY]MYCONFIG.CFG

    For more information about creating logical names, see OpenVMS User's Manual.


Specifying a User Configuration File

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:

$ SAS8/CONFIG=DISK:[DIRECTORY]MYCONFIG.CFG

Displaying the Contents of Configuration Files

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:

/LINESIZE=80/PAGESIZE=60

Suppose that you have also created your own configuration file, MYCONFIG.CFG, and that it contains the following options:

/FULLSTIMER

Now suppose you use the following command to invoke SAS:

$ SAS8/CONFIG=MYCONFIG.CFG/VERBOSE

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


Autoexec Files

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.  [cautionend]

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.

Creating an Autoexec File

To create an autoexec file, follow these steps:

  1. Use any text editor to write SAS statements into an OpenVMS file. Use .SAS as the file type.

  2. Type in the SAS statements that you want to include.

  3. Close the new autoexec file.

  4. Create the logical name SAS$INIT in the appropriate logical name table. For example, the following DCL DEFINE command creates the logical name SAS$INIT in the process-level logical name table.
    $ DEFINE SAS$INIT-
    _$ DISK:[DIRECTORY]MYEXEC.SAS

    For more information about creating logical names, see OpenVMS User's Manual.


Specifying an Autoexec File

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:

$ SAS8/AUTOEXEC=DISK:[DIRECTORY]MYEXEC.SAS

Displaying Autoexec Statements in the SAS Log

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.

$ SAS8/AUTOEXEC=MYEXEC.SAS8/ECHOAUTO

For more information about the ECHOAUTO system option, see SAS Language Reference: Dictionary.


OPTIONS Statement

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.

OPTIONS Procedure

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 OPTIONS and SAS Language Reference: Dictionary.

System Options Window

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:

You can select a group of system options by clicking on the icon to the left of the group name in the left side of the System Options window. To open a subgroup either click on the icon to the left of the subgroup name in left side of the window or double-click on the subgroup name in the right side of the window. You will see a list of the system options in that subgroup, along with their values and a brief description.

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:

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.

GETOPTION Function

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:

  1. System Options window or OPTIONS statement (submitted from a SAS session or job).

  2. autoexec files that contain OPTIONS statements (after SAS is initialized but before the user supplies input):
    1. process-level autoexec file

    2. job-level autoexec file

    3. group-level autoexec file

    4. system-level autoexec file.

  3. SAS command.

  4. configuration files (as SAS is being initialized):
    1. process-level configuration file

    2. job-level configuration file

    3. group-level configuration file

    4. system-level configuration file.

  5. VMS_SAS_OPTIONS DCL symbol:
    1. local symbol definition

    2. global symbol definition.

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:


SASUSER Library

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=.

Creating Your Own SASUSER Libraries

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:

$ SAS8/SASUSER=DISK:[MYSUSER]

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.  [cautionend]

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:

SASAUTOS
defines to the SAS System the location of the autocall macro library, which contains SAS programs defining SAS macros. For more information, see Autocall Libraries.

SAS$EXTENSION
defines to the SAS System the location of examples of user-written extensions to the SAS System, as well as the parts of the SAS System that are specific to the OpenVMS system. This is a rooted, concealed logical name.

SAS$GDEVICE
defines to the SAS System the output destination for a graphics device. SAS$GDEVICE defaults to your terminal, SAS$TERMINAL.

SAS$HELPLOC
defines the location of the online help files. SAS$HELPLOC corresponds to the HELPLOC system option. For more information, see HELPLOC.

SAS$LIBRARY
defines the search path that the SAS System uses to load executable images. SAS searches for executable images in the following order:
  1. SYS$DISK:[ ]

  2. SAS$ROOT:[PROCS]

  3. SAS$ROOT:[IMAGE]

  4. SAS$EXTENSION:[LOAD]

Note:   If 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$.  [cautionend]

SAS$SECTION
defines the file specification for the native editor section file. For more information about native editors, see the command TPU.

SAS$TERMINAL
defines the output destination for a device. By default, SAS$TERMINAL is defined as SYS$OUTPUT.

SAS$USER
defines to the SAS System the location of the SASUSER data library. This logical name can be overridden by the SASUSER= system option. By default, SAS$USER is usually set to your default directory, SYS$LOGIN.

SAS$WORKROOT
defines the directory under which you want to create the WORK subdirectory. This can be overridden with the WORK= system option. By default, SAS$WORKROOT is defined as your current directory, SYS$DISK:[ ].

SAS$XDEFAULTS
defines the default location for X resource files that are used with Motif. For more information, see Customizing the SAS Windowing Environment.


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:

SAS$ALTLOG
contains the name of the current alternate SAS log file, if one is created. SAS$ALTLOG corresponds to the ALTLOG= system option. For more information, see the system option ALTLOG=.

SAS$ALTPRINT
contains the name of the current alternate SAS list file, if one is created. SAS$ALTPRINT corresponds to the ALTPRINT= system option. For more information, see the system option ALTPRINT=.

SAS$APPLETLOC
defines the location of Java applets to the SAS System. For more information, see APPLETLOC=.

SAS$CONFIG
defines to the SAS System the location of a configuration file. For more information, see Configuration Files and Precedence for System Option Specifications.

SAS$INIT
defines to the SAS System the location of an autoexec file. The AUTOEXEC= system option takes its value from SAS$INIT, if SAS$INIT is defined. For more information, see the system option AUTOEXEC=.

SAS$LOG
contains the name of the SAS log. SAS$LOG corresponds to the LOG= system option.

SAS$PRINT
contains the name of the SAS list file. SAS$PRINT corresponds to the PRINT= system option.

SAS$TRANTAB
specifies the names of translation tables that are used by various parts of the SAS System.

SAS$WORKLIB
points to your WORK subdirectory. For more information about the WORK subdirectory, see The WORK Data Library under OpenVMS.

SAS$X_STATUS
contains the OpenVMS status code that indicates whether an X command or X statement executed properly. The logical name is stored in the JOB logical name table and can be checked after the execution of any X command or statement. If the X command or statement was successful, the value is 1. Any other value indicates that the X command or statement was not successful.

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.  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.