This Natural profile parameter is used to control the sort program used
for the processing of SORT
statements. It corresponds to
the NTSORT
macro in the Natural parameter module
NATPARM
.
SORT
or NTSORT
can be used
to specify various options that control the handling of the sort program used
when a SORT
statement is
executed.
The sort program to be used can be either Natural's internal one (the
default for all environments) or an external one. The type of sort to be used
depends on the setting of the keyword subparameter
EXT
.
Possible settings | For an explanation of the individual options and their possible settings, see SORT Parameter Syntax below. | |
---|---|---|
Default setting | WRKSIZE=10,STORAGE=MAIN,EXT=OFF,EXTNAME=SORT,EXTEOJ=OFF |
|
Dynamic specification | yes |
This parameter can only be specified dynamically. In the Natural
parameter module |
Specification within session | no |
The following topics are covered below:
The SORT
parameter is specified as follows:
SORT=(WRKSIZE=nnn,STORAGE=medium,EXT=ON/OFF,EXTNAME=name,EXTOPT=(options,...),EXTEOJ=ON/OFF) |
The NTSORT
macro is specified as follows:
NTSORT WRKSIZE=nnn,STORAGE=medium,EXT=ON/OFF,EXTNAME=name,EXTOPT=(options,...),EXTEOJ=ON/OFF |
The individual keyword subparameters are explained below.
The following keyword subparameters are available:
WRKSIZE
|
STORAGE
|
EXT
|
EXTNAME
|
EXTOPT
|
EXTEOJ
WRKSIZE
specifies the size
nnnnnnn
(in KB) of the work buffer used
by the sort program.
Possible values: | 10 to 2097151 , or
0 .
|
Default value: | 10 |
If you specify WRKSIZE=0
, no sort operations can be
performed.
The work buffer specified by WRKSIZE
accommodates internal sort control data. The remaining storage is used to
collect and sort the records. The size of the sort control data depends on
various factors (the WRKSIZE
itself, the sort record
length, the number of sort keys, their size and format) and can therefore not
be calculated in a formal way.
STORAGE
specifies the type of storage
medium to be used by Natural's internal sort
program.
In general, the SORT
statement first tries to use the
remaining storage in WRKSIZE
. If the number of records
does exceed this storage, the SORT
statement tries to use
intermediate storage to additionally process records:
MAIN |
Only the remaining storage of WRKSIZE is
used, no other intermediate storage is available.
This is the default setting. |
BP |
The SORT buffer pool is used as intermediate
storage. See note below.
|
SD |
SD files are used as intermediate storage. This value is honored under Com-plete only. |
SMARTS |
SMARTS portable file system is used. |
The files are allocated as temporary SD files. They are allocated
for a stack level. This means, the name syntax of the SORT
SD
files is &&STsnnn
with:
&& |
Indicator for a temporary SD file |
ST | Standard prefix for the SD sort file |
s | Stack level |
nnn | Sequence number within a single SORT
run
|
SMARTS work files are located in the SMARTS Portable File System.
The path must be specified with the SMARTS environment variable
$NAT_WORK_ROOT
. A special directory named
SORT
for SORT
workfiles is added and for each user, a
different directory is created named by the user ID. The resulting directory is
then $NAT_WORK_ROOT/sort/userid
. The naming of the
SORT
work files corresponds to the SD files under Com-plete.
If you want to use a sort buffer pool, define the
SORT
keyword subparameter STORAGE=BP
to
indicate that a sort buffer pool is to be used for any additional storage
beyond the defined WRKSIZE
.
Simultaneously, use the profile parameter BPI
or the parameter
macro NTBPI
to make a buffer pool of TYPE
=SORT
and NAME
=name
known to Natural, for example: BPI=(TYPE=SORT,NAME=XYZ)
. When a
name ist specified with the BPI
keyword subparameter
NAME
, reference is made to a global sort buffer pool,
whereas a local sort buffer pool can be specified by NAME=' '
(blank).
EXT
specifies if an external sort program is to
be used or not:
ON |
An external sort program will be used. The use of an external sort program is possible only in batch environments, including IMS/BMP, TSO, TIAM and CMS. |
OFF |
The Natural SORT program will be used (this is the
default).
|
This subparameter does not apply under BS2000/OSD.
EXTNAME
specifies the
name
(1 to 8 characters) of the
external sort program to be used. The default name is SORT
.
This subparameter does not apply under BS2000/OSD.
EXTOPT
specifies additional
options
for the external sort
program.
Natural generates the necessary field and format parameters and passes
them to the external sort program. With EXTOPT
, you can
specify additional parameters to be passed to the external sort program. You
can only specify parameters that are part of the control statement syntax of
your external sort program.
You can specify up to two option strings which are delimited by a slash
(/). The first option string is appended to the SORT
control
statement, the second option string is used to build an OPTION
control statement. You may omit the option string before or after the slash. If
the option string after the slash is omitted no OPTION
control
statement is generated at all.
The whole option string must be enclosed in single quotes ('...'). For compatibility reasons, it is still possible to have the option string enclosed in brackets instead.
For compatibility reasons, a single option string without a leading or trailing slash is handled differently. Depending on the underlying operating system, the options are appended to the following control statements:
z/OS and VM/CMS: | SORT control statement
|
z/VSE: | OPTION control statement
|
The additional parameters can be specified as in the following example:
EXTOPT=(SIZE=E2000000,NOEQUALS,DYNALLOC=(3350,8)) EXTOPT='SIZE=E2000000,NOEQUALS,DYNALLOC=(3350,8)' EXTOPT='SIZE=E2000000,NOEQUALS,DYNALLOC=(3350,8)/NOCHECK' EXTOPT='/NOCHECK' EXTOPT='WORK=4/'
EXTEOJ
specifies the action to be taken if an
error is detected during the execution of the external sort program:
ON |
If an error is detected, SORT processing is
terminated. ON requires that the SORT program used is
able to detect a return code of 16 from both the E15 and
E35 SORT exit routines.
|
OFF |
If an error is detected, Natural withholds further calls to the
sort program and ignores each record as it is passed to the E35
SORT exit routine (this is the default).
|