| SAS Companion for the OS/390 Environment |
Whether you are using interactive
processing under TSO
or batch processing, you may want to customize certain aspects of your SAS
session. 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.
You can customize your SAS session in five ways:
-
Under TSO, pass operands into the SAS CLIST that
your site uses to invoke SAS. (See Invoking SAS under TSO: the SAS CLIST.) This method is usually used for one-time
overrides of CLIST operands. Here is an example:
sas options('nocenter linesize=80')
config('''my.config.file''')
-
In batch mode, pass parameters into the SAS cataloged
procedure that your site uses to invoke SAS. (See Invoking SAS in Batch Mode: the SAS Cataloged Procedure.) This method is usually used for one-time
overrides of parameters in the cataloged procedure. Here is an example:
//MYJOB EXEC SAS,
// OPTIONS='NOCENTER, LINESIZE=80',
// CONFIG='MY.CONFIG.FILE'
-
Specify SAS system options in a user configuration
file. (See Configuration Files.)
This method is useful if you, as an individual user, always want to override
the values of system options that are specified in your site's system configuration
file.
-
Execute SAS statements (such as OPTIONS, LIBNAME,
and FILENAME statements) in an AUTOEXEC file. (See Autoexec Files.) This method is most useful for specifying
options and allocating files that pertain to a particular SAS application.
-
In interactive mode, specify a SASUSER library
that contains a user profile catalog. (See SASUSER Library.)
See
Precedence for Option Specifications
for information about the order of precedence for these methods.
A configuration file contains SAS system options
that are set automatically when you invoke SAS. SAS uses two types of configuration
files:
To create a user configuration file, use any text editor
to write SAS system options into an physical file. The configuration file
can be either a sequential data set or a member of a partitioned data set
that contains 80-byte fixed-length records. When you allocate a system or
user configuration file, you must specify LRECL=80 and RECFM=FB.
Whichever type of data set you choose, specify one or
more system options on each line. If you specify more than one system option
on a line, use either a blank or a comma to separate the options.
Some options can be thought of as on (enabled) or off
(disabled). Specifying just the keyword enables the option; specifying the
keyword prefixed with NO disables the option. For example, the configuration
file might contain these option specifications:
NOCENTER
NOSTIMER
NOSTATS
All of these options are disabled.
Options that take a value must be specified in the following
way:
option-name=value
For example, a configuration file might contain the
following lines:
LINESIZE=80
PAGESIZE=60
Note:
When you specify SAS system
options in a configuration file, blank spaces are not permitted before or
after an equal sign. Comment lines must start with an asterisk in column 1.
A configuration file can contain any system option except
the CONFIG= option. If CONFIG= appears in a configuration file, it is ignored;
no error or warning message appears.
To tell SAS where to find your user configuration file,
do the following:
The user configuration file that you specify is executed
along with the system configuration file that your installation uses. This
happens because the SAS CLIST or the SAS cataloged procedure concatenates
the file that you specified to the system configuration file.
Note:
The SAS system options that you specify in the user configuration
file override system options that are specified in the system configuration
file.
Under OS/390, an autoexec file can be either a sequential data
set or a member of a partitioned data set. Unlike configuration files, which
contain SAS system options, an autoexec file contains SAS statements. These
statements are executed immediately after SAS has been fully initialized and
before any SAS input source statements have been processed. For example,
an autoexec file could contain the following lines:
options fullstats pagesize=60 linesize=80;
libname mylib 'userid.my.lib';
dm 'clock';
The OPTIONS statement sets some SAS system options,
the LIBNAME statement assigns a library, and the DM statement executes a command.
Note:
Some SAS system options can be specified only when you
invoke SAS. These system options cannot be specified in an OPTIONS statement;
therefore, they cannot be specified in an autoexec file. See Summary of All SAS System Options Available under OS/390 for information about
SAS system options and about where they can be specified.
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.
Under TSO, use the AUTOEXEC
operand when you invoke SAS to tell
SAS where to find your autoexec file. For example, the following command
invokes SAS and tells SAS to use an autoexec file named MY.EXEC.FILE:
sas autoexec('''my.exec.file''')
To specify an autoexec
file in a batch job, use a JCL DD statement
to assign the DDname SASEXEC to your autoexec file. This DD statement must
follow the JCL EXEC statement that invokes the SAS cataloged procedure. For
example, the following two lines of JCL can be used to accomplish the same
results in a batch job as the previous example did under TSO:
//MYJOB EXEC SAS
//SASEXEC DD DSN=MY.EXEC.FILE,DISP=SHR
The SASUSER library contains SAS catalogs that enable
you to customize certain features of SAS while your SAS session is running
and to save these changes. For example, in base SAS software, any 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, SAS/ACCESS descriptor files, and additional
SAS catalogs in your SASUSER library.
When you use the SAS CLIST that is supplied by SAS Institute
to invoke SAS under TSO, the CLIST allocates an physical file to be used as
the SASUSER library during your SAS session. The SASUSER library is normally
used only in interactive processing; the SAS cataloged procedure, which invokes
SAS in batch processing, does not allocate a 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.
(See Using the PRINT Command and the FORM Subsystem
and
SAS Language Reference: Dictionary for information about the
FORM subsystem.)
Note:
If your SAS CLIST has been modified
so that it does not create a SASUSER library, SAS creates a PROFILE catalog
that is used to store profile information for use during a single SAS session.
This catalog is placed in the WORK library and is deleted at the end of your
session; it is not available to a subsequent SAS session.
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.
In order to do this, you must first create a SAS data
library that can be used as the SASUSER library.(footnote 1)
The easiest way to accomplish this is to start a SAS
session and then use a LIBNAME statement or LIBNAME function to create the
library, as explained in Allocating SAS Data Libraries Internally.
For example, to create a SAS data library with an physical file name of ABC.MY.SASUSER,
submit the following LIBNAME statement:
libname newlib 'abc.my.sasuser' disp=new;
Notice that a libref of NEWLIB was used in this example.
SASUSER is a reserved libref and cannot be reassigned during a SAS session.
You can also use the TSO ALLOCATE command to create
an physical file for use as your SASUSER library. By using the ALLOCATE command,
you can avoid using the LIBNAME statement or LIBNAME function; however, you
must be familiar with TSO commands and with DCB (data control block) attributes
in order to use the ALLOCATE command effectively. Here is a typical ALLOCATE
command for the SASUSER library that provides satisfactory performance at
many sites:
alloc fi(newlib) da('abc.my.sasuser') new
catalog space(80 20) dsorg(ps) recfm(f s)
blksize(6144) reu
When you enter this ALLOCATE command from the READY
prompt, an physical file named ABC.MY.SASUSER is created with the correct
attributes for a SAS data library.
In order to use the new SAS data library as the SASUSER
library, you must end your SAS session and start a second session. When you
start a second session, you can use the SASUSER CLIST operand to specify ABC.MY.SASUSER
as the SASUSER library. (See the next section.)
After creating your own
permanent SAS data library, designate
that library as your SASUSER library. You can do this in either of the following
ways:
Both of these methods
require that you identify the
SAS data library when you invoke SAS; you cannot change the SASUSER library
during a SAS session.
SAS system options control many aspects of your SAS session,
including output destinations, the efficiency of program execution, and the
attributes of SAS files and data libraries.
After a system option is set, it affects all subsequent
DATA and PROC steps in a process until it is specified again with a different
value. For example, the CENTER|NOCENTER option
affects all output from a process, regardless of the number of steps in the
process.
The default values for SAS system options are appropriate for
many of your SAS programs. If you need to specify or change the value of
a system option, you can do so in the following ways:
-
Create a user configuration file to specify values
for the SAS system options whose default values you want to override. See Creating a User Configuration File
for details.
-
Under TSO, you can specify any SAS system option
following the OPTIONS parameter in the SAS CLIST command:
sas options('option-list')
For options that can be on or off, just list the keyword
that corresponds to the appropriate setting. For options that take a value,
list the keyword identifying the option followed by an equal sign and the
option value, as in the following example:
sas options('nodate config=myconfig')
-
In batch mode, you can specify any SAS system
option in the EXEC SAS statement:
// EXEC SAS,OPTIONS='option-list'
For example:
// EXEC SAS,
// OPTIONS='OPLIST LS=80 NOSTATS'
-
Specify SAS system options in an OPTIONS statement
in an autoexec file, which is executed when you invoke SAS, or in an OPTIONS
statement at any point during a SAS session. Options specified in an OPTIONS
statement apply to the process in which they are specified, and are reset
for the duration of the SAS session or until you change them with another
OPTIONS statement.
For example:
options nodate linesize=72;
See Summary of All SAS System Options Available under OS/390
to find out whether a particular option can be specified in the OPTIONS statement.
For more information about autoexec files, see Autoexec Files. For more information about the OPTIONS
statement, see
SAS Language Reference: Dictionary and
SAS Language and Procedures: Usage.
-
Change SAS system options from within the OPTIONS window.
On a command line, enter the keyword OPTIONS.
The OPTIONS window appears. Place
the cursor on any option setting and type over the existing value. The value
will be saved for the duration of the SAS session only. Not all options are
listed in the OPTIONS window. See OPTIONS Window
for more information.
Your SAS Support Representative may have created a default
options table or a restricted options table. These tables are documented
in the installation instructions for the SAS System in the OS/390 environment.
They can affect the settings of SAS system options for your SAS sessions.
You can determine where host options get their values
by using the VALUE parameter of the OPTIONS procedure. For example, submit:
proc options host value;
run;
Then check the field named How Option is Set to determine if the
value is the shipped default, or if the value was set in the default options
table, or if the value was set in the SAS configuration file.
Contact your SAS Support Representative for more information.
To display the
current settings of SAS system options, use the
OPTIONS procedure or the OPTIONS window.
Some options may seem to have default values even though
the default value listed in Summary of All SAS System Options Available under OS/390
is none. This happens when the option is set in a system configuration file,
in the default options table, or in the restricted options table.
You can use the VALUE parameter of the OPTIONS procedure
to see when an option's value was set.
The OPTIONS procedure writes to the SAS log all system
options
that are available under OS/390. 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 SHORT option:
proc options short;
run;
Under OS/390, PROC OPTIONS also supports some additional
options for listing system options that are specific to SAS/ACCESS interfaces
or to the SAS interface to ISPF. See OPTIONS for details.
To display the OPTIONS window, enter
OPTIONS from a command
line. The OPTIONS window displays the settings of many SAS system options.
When the same
option is set in more than one place, the order
of precedence is as follows:
-
OPTIONS statement or OPTIONS window.
-
restricted options table, if there is
one.
-
SAS invocation, including invocation by way of
an EXEC SAS JCL statement (in batch) or by way of the SAS CLIST command (under
TSO)
-
user configuration file, if there is one
-
system configuration file (as the SAS System is
initialized)
-
default options table, if there is one
For example, options that you specify during your SAS
session (using the OPTIONS statement or OPTIONS window) take precedence over
options that you specified when you invoked SAS. Options that you specify
with the SAS CLIST command take precedence over settings in the configuration
file. The settings in the user configuration file take precedence over settings
in the system configuration file and in the default options table.
FOOTNOTE 1:
This must be a Version 7 SAS data library that is created
with the V7 engine.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.