TCB

File 24
Op-Sys z/OS
Statement FIND
Task Retrieve Task Control Block for a given job and interpret its contents.

Common Fields for all Operating Systems

Dictionary Field Name F/L Mu DE Remarks
ERROR-CODE N3      
ERROR-TEXT A58      
NODE N5   D  
NODE-NAME A16   D  
JOB-NAME A8   D Required.
TCB-ADDRESS B4   D  
RB-CHAIN B4   D  
DEB-CHAIN B4   D  
LLS-CHAIN B4   D  
COMPLETION-CODE B4   D  
MOTHER-TCB B4   D  
SISTER-TCB B4   D  
DAUGHTER-TCB B4   D  

Relevant Error Codes

Code Text z/OS
801 Job not found X
805 Invalid TCB address X

Field Descriptions

Field Name Type/Length Operating System
COMPLETION-CODE (B4)  

Completion code for the task.

Field Name Type/Length Operating System
DAUGHTER-TCB (B4)  

TCB address of task last attached by this task.

Field Name Type/Length Operating System
DEB-CHAIN (B4)  

Address of DEB chain (open datasets).

Field Name Type/Length Operating System
JOB-NAME (A8)  

Name of job to be scanned.

Field Name Type/Length Operating System
LLS-CHAIN (B4)  

Address of LLS chain (loaded programs).

Field Name Type/Length Operating System
MOTHER-TCB (B4)  

TCB address of task which attached this task.

Field Name Type/Length Operating System
RB-CHAIN (B4)  

Address of request block chain (active programs).

Field Name Type/Length Operating System
SISTER-TCB (B4)  

TCB address of task previously attached by the task which attached this task.

Field Name Type/Length Operating System
TCB-ADDRESS (B4)  

TCB address.

Example 1:

This example program displays the TCB for job NPRWKK:

FIND TCB with JOB-name = 'NPRWKK' and NODE = 29
  DISPLAY TCB-ADDRESS RB-CHAIN DEB-CHAIN MOTHER-TCB SISTER-TCB
  END  

Example output from above program:

  TCB-ADDRESS RB-CHAIN DEB-CHAIN MOTHER-TCB SISTER-TCB
  ----------- -------- --------- ---------- ----------

  008DDD40    008DB428 00000000  008D5A68   008DD6B8
  008DD6B8    008DB940 00000000  008D5A68   008D5508
  008D5468    008FBE18 008DFE94  008FE1F8   00000000
  008FE1F8    008FBF87 008E96C4  008FF338   008FE4A8
  008D57B8    008DB170 00000000  008D5A68   008DD160
  ....

Example 2:

This example program displays the users of TCB addresses for job NPRWKK:

FIND TCB WITH JOB-NAME = 'NPRWKK' AND NODE = 29
  FIND NATPROC-USERS WITH TCB-ADDRESS = TCB.TCB-ADDRESS
                             AND NODE = 29
  DISPLAY TCB-ADDRESS USER-ID
  END

Example output from above program:

TCB-ADDRESS  USER-ID
  -----------  -------
  008DDD40     WKK
  008DD6B8     DL
  008D5A68     ****MAIN
  008D5508
  008FE1F8
  008D57B8
  008FE4A8
  008FF338
  008DD160
  008DD2F8