SCHED request

You can use the SCHED request to schedule a PSB in IMS DB. The first SCHED request made by a CCTL thread requires a new DRA thread. Existing DRA thread TCBs are used if they are not currently processing a DRA thread.

If no TCBs are available, the DRA either creates a new thread TCB (until the maximum number of threads as specified by the MAXTHRD parameter in the INIT request is reached), or makes the SCHED request wait until a thread becomes available.

The value in the PAPLWCMD field indicates whether the thread to which the SCHED request applies is a short or long thread. The type of thread determines the action that IMS takes when a database command is entered for a database scheduled to the thread. The /STOP DATABASE, /DBDUMP DATABASE, or /DBRECOVERY DATABASE command issued against a database scheduled on a short thread will wait for the database to be unscheduled. IMS rejects these commands if they are entered for a database scheduled on a long thread.

You must fill in the following input fields in the PAPL:

Field
Contents
PAPLFUNC
PAPLTFUN, thread function code
PAPLSFNC
PAPLSCHE, schedule request subfunction code
PAPLCTOK
The DRA request token (output from an INIT request)
PAPLTTOK
The thread token set up by the CCTL
PAPLRTOK
The 16-byte UOR token (RTOKEN).

The first 8 bytes contain the CCTL identification. This identification is the same as the CCTL ID that was a final DRA startup parameter determined from USERID or PAPLUSID in INIT request; the USERID parameter is found in the DFSPRP macro used to generate the DFSPZPxx module. The second 8 bytes contain the unique identifier specified by the CCTL for each UOR.

PAPLPSB
The PSB name
PAPLWRTH
Deadlock Worth Value

If this thread hits a deadlock condition with any other DRA thread or with any IMS region, DBCTL collapses the thread with the lower deadlock worth value.

PAPLWCMD
This bit defines the thread as either a short or long thread which determines what action IMS takes on a /STOP DATABASE, /DBDUMP DATABASE, or /DBRECOVERY DATABASE command for a database scheduled to the thread.

If the bit is set on (X'80'), the database is scheduled on a short thread; if the bit is set off, the database is scheduled for a long thread.

PAPLFTRD
Fast Path Trace Option

If this bit is on (X'40'), Fast Path tracing in IMS DB is activated.

PAPLKEYP
Public Key Option

If this bit is set (X'10'), DBCTL builds UPSTOR area in a special subpool so that applications running in public key can fetch the UPSTOR area.

PAPLLKGV
Lockmax Option

If this bit is set (X'08'), DBCTL uses the value in PAPLLKMX as the maximum number of locks that this UOR can hold. Exceeding the maximum results in a U3301 abend.

PAPLLKMX
Lockmax Value, 0 to 255

This value overrides any LOCKMAX parameter specified on the PSBGEN for the PSB referenced in the SCHED request.

PALPUFXT
DRA open thread indicator.

Set PAPLUFXT to 1 for the SCHED call to indicate to the DRA that the thread TCB might not be the same TCB for the duration of the thread. The TCB might change between the time that the PSB is scheduled and the time that the PSB is unscheduled and the thread is terminated.

PAPLALAN
Application language type

Specifying the following input field is optional:

Field
Contents
PAPLSTAT
Address of an area where scheduled statistical data is returned to the CCTL.

If you do not want to allocate an address, enter 0.

PAPLPBTK
Address of the token for the z/OS® Workload Manager performance block obtained by the CCTL.

You must specify this field for z/OS Workload Manager support for DRA threads.

PAPLTECB
To use the default Suspend exit routine and Resume exit routine, each DRA request must have the field PAPLTECB set with the address of a CCTL ECB to be used if the thread is waited or posted. If your CCTL does not provide Suspend and Resume exit routines, the DRA default exit routines will be used.

The output fields returned in the PAPL to the CCTL are:

Field
Contents
PAPLRETC
The return code
PAPLCTK2
The thread request token number 2. This is another DRA token required on future DRA requests originating from this thread.
PAPLPCBL
The address of the PCB list. There is one entry in the list for each PCB in the PSB that was scheduled, even if the PCB cannot be used with IMS DB.

The address of the PCB list is above the 16 MB line if either the PCBLOC=31 is set on the DFSPRP macro, or PAPLLPSO=31 is specified on the INIT request.

PAPL1PCB
The address of the PCBLIST entry pointing to the first database PCB
PAPLIOSZ
The size of the maximum I/O area
PAPLPLAN
The language type of the PSB
PAPLMKEY
The maximum key length
PAPLSTAT
The address of the schedule statistical data area. This address must be specified on the input field.

CCTLs currently using the IMS Database Manager and migrating to DBCTL will experience a change in the PCBLIST and user PCB area on a schedule request. The first PCB pointer in the PCBLIST contains the address of an I/O PCB. The I/O PCB is internally allocated during the schedule process in a DBCTL environment. The I/O PCB is normally used for output messages or to request control type functions to be processed. The PCBLIST and the PCBs reside in a contiguous storage area known as UPSTOR. If the PSB was generated with LANG=PLI, the PCBLIST points to pointers for the PCBs. If LANG= was not PLI, the PCBLIST points to the PCBs directly.