SORT control statement
Use the SORT control statement to set options for one or more sort tasks.
You can also use the SORT control statement to control the number of concurrent change accumulation groups to process; see SERIAL-keyword for more information. Keywords identify the maximum key length, the maximum record length of the input log records, virtual storage to use for sorting, and the characteristics and size of the sort work data sets.
Keywords specified on the SORT control statement override the corresponding keywords specified in the internal defaults, the global options module, or on the GLBL control statement.
You can place the SORT control statement anywhere in the input stream following the GLBL control statement. If you use multiple SORT control statements, each must have a unique name.
The following list indicates the keywords that are allowed on the SORT control statement. The SORT-keyword is required. Refer to CAPSYSIN-keywords for specifics about each keyword.
You must provide each sort task with its own sort work data set DD statements, unless you dynamically allocate them. If you include sort work DD statements, the first four characters of the ddname must match the sort task name. The following example shows how to assign sort work data sets to a sort task.
//SRT1WK02 DD UNIT=WORK,...
//CAPSYSIN DD *
GLBL DBRC(Y)
SORT SORT(SRT1) MAINSIZE(400K)
GROUP CAGRP(GROUP1) FUNC(CA) SORT(SRT1)
The following example shows how to assign two sorts to a single change accumulation group. SRT1 is the default sort task. However, DBD1 and DBD2 are assigned to sort task SRT2. SORT control statements are not needed.
//SRT1WK02 DD UNIT=WORK,...
.
.
//SRT2WK01 DD UNIT=WORK,...
//SRT2WK02 DD UNIT=WORK,...
.
.
//CAPSYSIN DD *
GLBL DBRC(Y)
GROUP CAGRP(GROUP1) FUNC(CA) SORT(SRT1)
CA DBD(DBD1) DDN(DDN1) SORT(SRT2)
CA DBD(DBD2) DDN(DDN2) SORT(SRT2)
Sort tasks are assigned to a change accumulation group either explicitly or implicitly. To explicitly assign a sort task to a change accumulation group, use SORT(name) on the GLBL, GROUP, or CA control statement.
If you do not include SORT(name) on a GLBL, GROUP, or CA control statement, the Change Accumulation utility uses SORT as the default sort task name.
The following example shows how to explicitly assign a sort task to a change accumulation group. Two sort tasks are specified, each with its own dynamically allocated sort work data sets. SORT control statements are not needed.
GLBL DBRC(Y) SORTWK(6,SYSDA,C,10,5)
GROUP CAGRP(GROUP1) FUNC(CA) ... SORT(SRT1)
GROUP CAGRP(GROUP2) FUNC(CA) ... SORT(SRT2)
To implicitly assign a sort task to a change accumulation group or specific database data set, omit the SORT keyword from the GROUP or CA control statement.
The following example shows how to assign sort work data sets to the default sort task. Since no sort keyword is provided on the GROUP control statement, the Change Accumulation utility will assign the default sort name SORT to the sort task.
// SORTWK02 DD UNIT=WORK,...
// CAPSYSIN DD *
GLBL DBRC(Y)
GROUP CAGRP(GROUP1) FUNC(CA)
The following example shows how to assign sort tasks based on key length. In this example, all log records for nonkeyed databases are assigned to sort task SRT1. The Change Accumulation utility uses the RBA/RBN for sequencing nonkeyed databases. (The RBA/RBN is 4 bytes long; hence KEYLEN(4) is specified.) All log records for keyed databases are assigned to sort task SRT2. (This assumes the key length for each database exceeds 4 bytes. A database with a key length of 4 or less is placed in SRT1.) By using this method, overall sort work requirements should be reduced.
GLBL DBRC(Y)
SORT SORT(SRT1) KEYLEN(4) SORTWK(6,WORK,C,100,5)
SORT SORT(SRT2) KEYLEN(255) SORTWK(4,WORK,C,20,5)
GROUP CAGRP(GROUP1) FUNC(CA)
If you want SMS to manage the sort work data sets, use the SWDATACL, SWMGMTCL, and SWSTORCL keywords to assign the data sets to the appropriate data class, management class, and storage class.
GLBL DBRC(Y) TIME(Y) DSALLOC(Y) EXTERNAL(Y)
SORT SORT(SRT1) MAINSIZE(MAX) SORTWK(5,SYSALLDA,C,100,100) -
SWDATACL(DATACL1) -
SWSTORCL(STORCL1) -
SWMGMTCL(MGMTCL1)
GROUP CAGRP(CAGRPT01) FUNC(CA) SORT(SRT1) CA((*,MODL01))
...
Related topic