The SET CURRENT DEGREE statement assigns a value to the CURRENT DEGREE special register.
This statement can be embedded in an application program or issued interactively. It is an executable statement that can be dynamically prepared. It must not be specified in REXX.
The privileges held by the authorization ID of the statement must include the system authority of *JOBCTL.
.-=-. >>-SET--CURRENT DEGREE--+---+--+-string-constant-+------------->< +-variable--------+ '-DEFAULT---------'
The value of CURRENT DEGREE is replaced by the value of the string constant or variable. The value must be a string with an actual length that is not greater than 5 after trimming any leading and trailing blanks. The value must be one of the following:
Use of parallel processing and the number of tasks used is determined based on the number of processors available in the system, this job's share of the amount of active memory available in the pool in which the job is run, and whether the expected elapsed time for the operation is limited by CPU processing or I/O resources. The database manager chooses an implementation that minimizes elapsed time based on the job's share of the memory in the pool.
The variable:
Transaction considerations: The SET CURRENT DEGREE statement is not a commitable operation. ROLLBACK has no effect on CURRENT DEGREE.
Initial current degree: The initial value of CURRENT DEGREE is equal to the parallelism degree in effect from the CHGQRYA CL command, PARALLEL_DEGREE parameter in the current query options file (QAQQINI), or the QQRYDEGREE system value.
Parallelism degree precedence: The parallelism degree can be controlled in several ways. The actual parallelism degree used is determined as follows:
For more information, see Database Performance and Query Optimization.
Current degree scope: The scope of CURRENT DEGREE is the job.
Parallel limitations: If the DB2® UDB Symmetric Multiprocessing feature is not installed, a warning is returned and parallelism is not used.
Some SQL statements cannot use parallelism.
Example 1: The following statement sets the CURRENT DEGREE to inhibit parallelism.
SET CURRENT DEGREE = '1'
Example 2: The following statement sets the CURRENT DEGREE to allow parallelism.
SET CURRENT DEGREE = 'ANY'