z/OS JES2 Macros
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


$CBIO – Control block I/O routine

z/OS JES2 Macros
SA32-0996-00

Use $CBIO to access the control block I/O ($CBIO) service routine to perform I/O for JES2 control blocks.

Note: The caller must hold the SJB lock and cannot hold any other MVS™ lock. The address of the SJB must be in register 10 prior to calling $CBIO, unless you specify the SJB= or SJIOB= keywords on the $CBIO macro.

Format description

Read syntax diagramSkip visual syntax diagram
>>-+--------+--$CBIO-------------------------------------------->
   '-symbol-'          

>--TYPE--=--+-READ-------------------------+-------------------->
            +-WAIT-------------------------+   
            '-+---+--WRITE--+------------+-'   
              '-(-'         '-,--COND--)-'     

>--,BUFAD--=--+-WRITE-+--,MTTR--=--+-label------+--------------->
              '-READ--'            '-(--R--n--)-'   

>--,MQTR--=--+-label------+--,VERIFY--=--+-cb-id------+--------->
             '-(--R--n--)-'              +-NONE-------+   
                                         '-(--R--n--)-'   

>--+-------------------+---------------------------------------->
   |           .-YES-. |   
   '-,EXIT--=--+-NO--+-'   

>--+------------------------------------------------+----------->
   '-,STORPTR--=--cb-label--,--SPOLPTR--=--cb-label-'   

>--+------------------------------------------------+----------->
   '-,CKPTFLD--=--cb-label--,--CKPTBIT--=--cb-label-'   

>--+---------------------------+-------------------------------->
   '-,ERRET--=--+-addrx------+-'   
                '-(--R--n--)-'     

>--+---------------------------+--+-------------------+--------->
   '-,OKRET--=--+-addrx------+-'  |           .-NO--. |   
                '-(--R--n--)-'    '-,FREE--=--+-YES-+-'   

>--+-------------------+--+-------------------------+----------->
   '-,JOBMASK--=--mask-'  '-,KEY--=--+-field------+-'   
                                     '-(--R--x--)-'     

>--+--------------------+--+-------------------+---------------->
   +-,SJB--=--+-addrx-+-+  '-,WAIT--=--+-YES-+-'   
   |          '-NO----' |              '-NO--'     
   '-,--SJI0B--=--addrx-'                          

>--+-------------------+--+------------------+------------------>
   '-JQE=--+-NONE----+-'  '-JQE_OFF=--offset-'   
           '-address-'                           

>--+---------------------+-------------------------------------><
   |             .-NO--. |   
   '-,SUPMSG--=--+-YES-+-'   

TYPE=
Specifies the type of I/O operation that is to be performed. This is a required parameter.
READ
Indicates this is an I/O read.
WAIT
Waits for the completion of a $CBIO request that specified WAIT=NO.

In a JES2 environment, when a $CBIO TYPE=READ or TYPE=WRITE request is made with WAIT=NO, verification processing and buffer management occurs when the I/O completes. No additional code is required of the caller of $CBIO. However, in a non-JES2 environment, this processing cannot be done automatically. In this case, a $CBIO TYPE=WAIT is needed to wait for the I/O to complete and then perform the required verification and buffer management. Therefore, TYPE=WAIT is only valid in a non-JES2 environment.

If WAIT=NO is specified in a non-JES2 environment, a $CBIO TYPE=WAIT call may be needed to complete verification of the control block and to perform any needed buffer management (including any error processing).

Note: For TYPE=WAIT, the parameters BUFAD=, MTTR=, VERIFY=, KEY=, STORPTR=, SJB=, WAIT=, FREE=, SPOLPTR=, JOBMASK=, CKPTFLD=, and CKPTBIT= are not valid. The values specified on the TYPE=WRITE or TYPE=READ are used. SJIOB= is required if TYPE=WAIT.
WRITE
Indicates this is an unconditional I/O write.
(WRITE,COND)
Indicates this is a conditional I/O write. That is, JES2 writes a control block only if the checkpoint bit (BUFM1CKP bit in byte BUFMFLG1) is on.

Specifying COND is mutually exclusive with the CKPTFLD and CKPTBIT parameter pair.

BUFAD=
WRITE THE BUFFER (TYPE=WRITE)
Specifies the label of, or a register that contains, the address of the input/output block (IOB) that corresponds to the buffer that is to be written to SPOOL. For TYPE=WRITE, you must also specify BUFAD= .
READ THE BUFFER (TYPE=READ)
Specifies the label of, or a register that contains, the address of the input/output block (IOB) that corresponds to the buffer that is to be read from SPOOL. For TYPE=READ, specifying BUFAD= is "optional" on the $CBIO macro. If you do NOT specify BUFAD= or specify BUFAD=0, then the $CBIO routing gets the buffer for you and puts its address into register 1 when it returns control. BUFAD is not allowed with TYPE=WAIT.
Note: Whether writing or reading the buffer:
  1. If you specify a register for BUFAD=, the address of the IOB must be loaded into this register before executing the $CBIO macro.
  2. When your I/O operations are complete, you are responsible for "freeing" the buffer you have used for your $CBIO operations. This is normally accomplished with the $FREEBUF macro. For more information on the $FREEBUF macro see $FREEBUF – Return a JES2 buffer to the JES2 buffer pool.
MTTR=
Specifies the label of, or a register that contains, the spool track address of the record to be read or written. If you specify a register, the spool MTTR (module track record) must be loaded into the designated register before executing this macro instruction. MTTR is required for TYPE=READ or TYPE=WRITE, but is not allowed with TYPE=WAIT.
MQTR=
Specifies the 6 byte MQTR SPOOL address of the record to read or write. If a register is used, it must contain the MQTR (0000mmtt ttttttrr). MQTR is required for TYPE= READ or TYPE=WRITE, but is not allowed with TYPE=WAIT. MQTR is not allowed in the JES2 environment.
Note: MQTR is mutually exclusive with MTTR.
VERIFY=
Specifies the control block identifier (cb-id) or a register that contains the address of the cb-id that is used to validate the control block passed to Exit 7 or 8. Specify the cb-id as a 4-byte EBCDIC value. If you specify NONE, JES2 will not verify the control block after the read; however, job key validation should be done. VERIFY is required if TYPE=READ or TYPE=WRITE, but is not allowed with TYPE=WAIT.
EXIT=
Specifies whether (YES) or not (NO) this macro instruction will call $EXIT7 or $EXIT8. EXIT=YES is the default.
Note: Because you can use this macro instruction in an installation-defined exit, and $CBIO calls Exit 8, you can use this keyword to allow or disallow recursive exit calls, as required.
STORPTR=
Specifies the offset of the chaining field that is used to perform a series of control block I/Os. For example, use this keyword if you need to write an entire IOT chain to spool. If you do not specify STORPTR=, only a single buffer (as specified by MTTR=) is either read or written. If STORPTR= is specified, SPOLPTR= is also required. The default for STORPTR is a null value (unspecified). STORPTR is not allowed with TYPE=WAIT. Blocks are written in the reverse order of the chain, that is, they are written from the newest to the oldest. If A points to B points to C, then the blocks are written in the order CBA.
SPOLPTR=
Specifies the offset of the field that is used to obtain the MTTR for a series of control block I/Os. For control block READ it is the offset of the field that contains the MTTR of the next control block. For control block WRITE it is the offset of the field that contains the MTTR of the current control block. For example, use this keyword if you need to write an entire IOT chain to spool. If SPOLPTR is not specified, only the single control block identified by MTTR= will be used. The default for SPOLPTR is a null value (unspecified). If STORPTR= is specified, SPOLPTR= is also required. SPOLPTR is not allowed with TYPE=WAIT.
CKPTFLD=
Specifies the offset into the buffer that is used to determine if this buffer is to be checkpointed. The bit (as specified by CKPTBIT=) must be set to one before writing the buffer to spool, if checkpointing is required. If the bit is not set on, and a chain of writes is not requested, $CBIO will not write this buffer to spool. If the bit is not set on and a chain of writes is requested, $CBIO will not write this buffer to spool and will check the next buffer (as pointed to by STORPTR=). If TYPE=WRITE and CKPTFLD was not specified, the buffer, or chain of buffers, will be unconditionally written. However, if CKPTFLD was specified, whether or not the buffer is written depends on the setting of CKPTBIT. If CKPTFLD= is specified, CKPTBIT= is required.

Specifying CKPTFLD is mutually exclusive with TYPE=(WRITE,COND).

CKPTBIT=
Specifies the bit to be checked in the field specified by CKPTFLD=. If this bit is set to one, the buffer is written to spool; if this bit is set to zero, the buffer is not written to spool. If CKPTFLD= is specified, CKPTBIT= is required.

Specifying CKPTBIT is mutually exclusive with TYPE=(WRITE,COND).

ERRET=
Specifies the label of, or a register that contains, the address of a routine that receives control if the I/O operation was unsuccessful (that is, if register 15 contains a nonzero return code). A chain of control blocks will not be written if an error is encountered during the I/O for that chain. ERRET= is optional, and either a label or register notation may be used to specify the error routine address.
OKRET=
Specifies the address of the routine that is to receive control when the I/O operation is successful (register 15 contains 0). You can specify a label that corresponds to the routine's address or a register that contains the address of the routine.
FREE=
Specifies whether or not the buffer should be freed after it is written, or after an error occurred. The default is NO. FREE= is mutually exclusive with TYPE=WAIT.
JOBMASK=
Specifies the job mask that will be used when calling exit 7. The job mask determines whether the exit can be taken for a particular job. If no job mask was specified, the exit will be taken without one. If the JCT is being read in, the job mask will be taken from this JCT. FREE= is mutually exclusive with TYPE=WAIT.
JQE=
Specifies one of the following values:
  • Label or register that contains the address of the JQE
  • NONE - which indicates that there is no related JQE for this I/O operation.
If the JQE address is not provided explicitly, but you can determine the JQE address because one of the following parameters is specified:
  • KEY=JQEJBKEY
  • MTTR=JQETRAK
  • KEY=IOTJBKEY
  • MTTR=IOTTRACK
  • KEY=JCTJBKEY
  • MTTR=JCTTRAK
JES2 will use the implicitly specified JQE/JQE_OFF.

If you do not specify JQE= nor JQE_OFF=, JES2 uses the JQE address contained in the PCEJQE. JQE= is mutually exclusive with JQE_OFF=.

JQE= is only valid in the JES2 environment.

JQE_OFF=
Specifies a label or register that contains the offset of the JQE.
If the JQE address is not provided explicitly, but you can determine the JQE address because one of the following parameters is specified:
  • KEY=JQEJBKEY
  • MTTR=JQETRAK
  • KEY=IOTJBKEY
  • MTTR=IOTTRACK
  • KEY=JCTJBKEY
  • MTTR=JCTTRAK
JES2 will use the implicitly specified JQE/JQE_OFF.

If you do not specify JQE= nor JQE_OFF=, JES2 uses the JQE address contained in the PCEJQE. JQE_OFF= is mutually exclusive with JQE=.

JQE_OFF= is only valid in the JES2 environment.

KEY=
Specifies the key field of the control block that will be verified by $VERIFY. If a register is used, it must contain the address of the field. If a key is not specified, only the control block identifier will be used to verify the control block. KEY= is mutually exclusive with TYPE=WAIT.
SJB=
Specifies either the address of the SJB, or NO. NO indicates that no SJB was specified, and the default (SJB address in register 10) is not to be used. If neither an SJB nor an SJIOB is specified, an SJIOB will be obtained and initialized. This parameter is used in the user environment only. SJB= is mutually exclusive with TYPE=WAIT.
SJIOB=
Specifies the address of the SJIOB. If specified, the SJIOB address will be loaded into register 10 and the SJB parameter will be ignored. This parameter is used in the user and subtask environments only.
WAIT=
Specifies whether or not the $CBIO service routine is to cause the caller to wait until the I/O operation completes (WAIT=YES). If not (WAIT=NO), control returns to the caller.
SUPMSG=

In JES2 environment specifies whether DISTERRs and dump are suppressed for an error condition discovered by CBIO.

In non-JES2 environment specifies whether messages HASP363, HASP364, HASP370 and the symptom record should be suppressed if there is an error condition discovered by CBIO.

NO is the default. YES means suppress.

Register contents when $CBIO is invoked

Register
Contents
2-9
Not applicable
11
HCT/HCCT/HFCT base address - as appropriate
12
Not applicable
13
PCE/Save area address - as appropriate
14-15
Not applicable

Register contents on exit from $CBIO

Register
Contents
0
Unchanged
1
READ - Address of buffer. If there was more than one READ operation, the register contains the address of the first buffer read.

WRITE - unchanged

2-9
Not applicable
10
User environment - SJB or SJIOB

JES2 environment - not applicable

14
Return address
15
Return code

Return codes

The following return codes (in decimal) are returned in register 15.
Return Code
Meaning
0
Processing completed successfully.
4
Processing failed because the control block was not valid.
8
Processing failed due to an I/O error.
12
Processing failed because the track address was not valid.
16
Processing failed because:
  • READ - JES2 was unable to obtain a buffer
  • WRITE - no buffer was passed to the $CBIO service
20
Processing failed because the caller did not hold the subsystem SJB lock. (Applicable in the user environment only.)
24
Processing failed because the control block read is of an unidentifiable type. JES2 could not verify the control blocks.
28
Processing failed because JES2 could not obtain storage for the SJIOB. (Applicable in the user environment only.)
32
Processing failed because the buffer does not have a valid buffer address table (BAT) entry. (Applicable in the JES2 maintask or subtask environment only.)

Environment

  • JES2 main task, JES2 subtask, and user environment.
  • $WAIT can occur.
  • MVS WAIT will occur in user environment.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014