MAXTASKS—Control the Number of Tasks

The MAXTASKS keyword controls the number of simultaneous tasks.
cafrdb220
The MAXTASKS keyword enables multitasking and controls the number of simultaneous tasks for the following operations:
  • Recovering objects
  • Reading tablespaces
  • Rebuilding indexes
  • Log sorting
  • Key sorting
  • Merging image copies
Recovery/Rebuild type
SORTLOG Value
MAXTASKS Controls
Recovery from image copies created at the partition level.
NO
Number of recovery tasks. Database objects or partitions are distributed among all recovery tasks.
Recovery from image copies created at the object level.
NO
Number of recovery tasks. Database objects are distributed among all recovery tasks.
Recovery from image copies that are created at the object level or the partition level.
YES, CONCURRENT
Number of log sort tasks. Database objects or partitions are distributed among all log sort tasks.
Recovery of tablespaces from image copies combined with concurrent rebuilding of the associated indexes.
YES
For RECOVER statements, sets the number of log sort tasks. Database objects or partitions are distributed among all tasks.
For REBUILD statements, sets the number of index rebuild tasks that each log sort task can attach.
Rebuilding of a partitioned index or indexes
n/a
Number of tablespace read and key sort tasks. Partitions are distributed among all tasks.
Rebuilding of a single non-partitioned index associated with a partitioned tablespace
n/a
Number of tablespace read and key sort tasks.
One more merge task is automatically attached to build the index pages.
Rebuilding of a combination of partitioned and non-partitioned indexes
n/a
Number of tablespace read tasks.
Each tablespace task reads a subset of partitions of the tablespace.
One key sort task is attached for each tablespace read task.
One more key sort task is automatically attached to process non-partitioned indexes.
Rebuilding of non-partitioned index or indexes
n/a
Number of key sort tasks. Indexes are distributed among all key sort tasks.
This keyword has the following format:
MAXTASKS
int
| PARALLEL
int
  • int
    Specifies the number of simultaneous tasks that can occur.
    Default:
    3
    Limits:
    1 - 20
To determine the value of MAXTASKS, use the following guidelines:
  • For tablespaces, set MAXTASKS to the number of image copy data sets from which the tablespaces are recovered.
  • For partitioned indexes, set MAXTASKS or PARALLEL to the number of partitions in the index to recover.
  • For multiple non-partitioned indexes, set MAXTASKS or PARALLEL to the number of indexes to recover.
  • For single non-partitioned indexes that are associated with a partitioned tablespace, set MAXTASKS to 8
The optimal MAXTASKS value depends on your system configuration.
If you specify a value that exceeds the number of available CPUs for your JCL, the performance might degrade because multiple tasks are competing for one CPU. In this case, set the MAXTASKS value to the number of CPUs that are available.
If you specify more than eight tasks, ensure that your JCL has enough main storage available.
More information: