z/OS MVS IPCS User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Following a Pointer Chain

z/OS MVS IPCS User's Guide
SA23-1384-00

Figure 1 gives a recursive function for following a chain of task control blocks (TCB). The function, CheckTCB, invokes Obtain_Data (see Figure 1) to retrieve the TCB pointers from the dump and Put (see Figure 1) to display the addresses.

Figure 1. Example of a REXX EXEC Function to Follow a TCB Structure
CheckTCB: Procedure expose storage.
TCBADDR= ARG(1)
GEN$ = " "
Call Put
Gen$ = "TCB at address "TCBADDR
Call Put
TCBNTC   = Obtain_Data(TCBADDR,128,4)
TCBLTC   = Obtain_Data(TCBADDR,136,4)
TCBRTWA  = Obtain_Data(TCBADDR,224,4)
TCBCMP   = Obtain_Data(TCBADDR,16,4)
Gen$ = " TCBntc...."TCBNTC
Call Put
Gen$ = " TCBltc...."TCBLTC
Call Put
Gen$ = " TCBrtwa..."TCBRTWA
Call Put
Gen$ = " TCBcmp...."TCBCMP
Call Put
/*************************************/
If TCBLTC ^= "00000000"
  Then
    Call CheckTCB TCBLTC
If TCBNTC ^= "00000000"
  Then
    Call CheckTCB TCBNTC
Return
If X'00F78400' is the address of a TCB, you would invoke this function as follows:
CheckTCB 00F78400

This simple function can be coded more efficiently using the RUNCHAIN subcommand to follow a chain of control blocks. A REXX function, however, allows you to customize the analysis of the control block chain. See Customizing Control Block Analysis for an example of customizing the CheckTCB function.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014