Defining a Header (TYPE=INITIAL)

Example:

DK1EXDFN TYPE=INITIAL,GLBLWORK=nnn,SHRDWORK=nnn,               X
EXITFLD=(REG_START_TIME,                                 X
REG_USER_ID,                                             X
REG_VTS_FIRST,                                           X
REG_VTS_LAST,                                            X
REG_VTS_PREFIX,                                          x
THRD_DD_NAME,                                            X
THRD_LIB_LIST,                                           X
THRD_STATUS_SW,                                          X
THRD_VTS_NAME,                                           X
TSR_CUR_#_OPEN,                                          X
TSR_CUR_SIZE,                                            X
TSR_HWM_#_OPEN,                                          X
TSR_HWM_SIZE,                                            X
TSR_START_TIME,                                          X
TSR_SYSTEM_SIZE,                                         X
TSR_TOTAL_CALLS)

GLBLWORK=nnn

This parameter was added with Release 6.1.0 and replaces the SWRKAREA parameter from previous releases of Version 6. The SWRKAREA parameter will still be supported for backward compatibility.

This parameter defines the size of a global non-thread-related work area The size of the global work area is user defined and can be set to zero, if not used. This area is shared by all of the exits for all of the tasks in the entire address space, that is, all exits for all threads. This means that all user exits will receive the address of the same area in storage.

This parameter is only valid when TYPE=INITIAL.

When an exit is invoked, the address of the global work area will be passed as Parameter 2. For more information, see Parameter 2: Global Work Area.

SHRDWORK=nnn

This parameter was added with Release 6.1.0 and replaces the WRKAREA parameter for the TYPE=INITIAL macro from previous releases of Version 6. The WRKAREA parameter will still be supported for backward compatibility.

This parameter defines the size of a work area that will be passed only to the following user exits:

  • BEFORE COMMAND and AFTER COMMAND exits (XLBCEUSR, XLACEUSR)
  • AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION exits (XLATIUSR, XLBTTUSR).

The size of the shared work area is user defined and can be set to zero, if not used. This area will be the same for all exits related to a single task, that is, all exits of the same thread. It can therefore be used for communication between the exits.

When an exit is invoked, the address of the shared, thread-related work area will be passed as Parameter 3. For more information, see Parameter 3: Shared Thread Related Work Area.

EXITFLD

This parameter is new with Release 6.1.0 and provides user exits with access to new fields. When an exit is invoked, the address for accessing these fields is passed in Parameter 1. For more information, see Parameter 1: Communication Area.

The field names within parentheses are keyword parameters so you only need to specify the field names for fields which are to be accessed by your user exits. The fields with prefix ‘TSR’ are similar to the fields returned in the LIST-BLOCK parameter for the LT command (see tableBASE Programming Guide for more details).

The fields for this parameter are described below.

REG_START_TIME

This is the 16 byte date and time that tableBASE was initialized in the region. The format for this field is yyyymmddhhmmssth where yyyymmdd is the gregorian date and hhmmssth is the time (th represents tenths and hundredths of a second).

This field can be accessed by all user exits.

REG_USER_ID

This is the 8 byte userid assigned to the job. This field can be accessed by all user exits.

REG_VTS_FIRST

This is the 8 byte VTSFIRST parameter from the TBOPT setting for the job. This field can be accessed by all user exits.

REG_VTS_LAST

This is the 8 byte VTSLAST parameter from the TBOPT setting for the job. This field can be accessed by all user exits.

REG_VTS_PREFIX

This is the 4 byte VTSPREFIX parameter from the TBOPT setting for the job. This field can be accessed by all user exits.

THRD_DD_NAME

This is the 8 byte DDNAME of the last tableBASE library used to access a table on a library.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

THRD_LIB_LIST

This is the 80 byte library list that is currently in use by tableBASE.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

THRD_STATUS_SW

This is the 8 bytes of status switches that is currently in use by tableBASE.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

THRD_VTS_NAME

This is an 8 byte field that returns the name of the TSR currently being used by this thread. If a local TSR is being used, the field contains the literal “LOCAL_DS”. If a VTS-TSR is being used, it contains the name of the VTS-TSR.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

TSR_CUR_#_OPEN

This is a 4 binary byte field that returns the number of tables that are currently open in the TSR.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

TSR_CUR_SIZE

This is a 4 binary byte field that returns the amount of TSR space, in bytes, that is currently in use.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

TSR_HWM_#_OPEN

This is a 4 binary byte field that returns the maximum number of tables that have ever been opened in the TSR.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

TSR_HWM_SIZE

This is a 4 binary byte field that returns the maximum amount of TSR space, in bytes, that has ever been used.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

TSR_START_TIME

This is a 16 byte field containing the date and time when the current TSR was started. The format for this field is yyyymmddhhmmssth where yyyymmdd is the gregorian date and hhmmssth is the time (th represents tenths and hundredths of a second).

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

TSR_SYSTEM_SIZE

This is a 4 byte binary field that returns the size of the TSR, in bytes.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).

TSR_TOTAL_CALLS

This is an 8 byte binary field that returns the total number of calls made on tables in the TSR.

This field can only be accessed by the BEFORE COMMAND, AFTER COMMAND, AFTER THREAD INITIALIZATION and BEFORE THREAD TERMINATION user exits (XLBCEUSR, XLACEUSR, XLATIUSR and XLBTTUSR).