The format of the data event control block is as follows:
Bytes | Contains |
---|---|
0-3 | Full word of zeroes. |
4 | Type flag: x'80' if 'S' parameter used in macro else x'00'. |
5 | Subtype flag: always x'20'. |
6 - 7 | Two-byte binary field set to value of the length parameter unless 'S' specified or register notation used in which case the field will be set to 0. |
8 - 11 | Address of DCB. |
12 - 15 | Address of area to receive data. |
Causes one block of a BSAM file to be transferred from a file to a buffer in memory. The user program is responsible for any deblocking or other processing that may be required if the block contains more than one logical record.
The data event control block (DECB) generated by the macro is mainframe-compatible, however, each READ operation is synchronous, that is, control is not returned to the calling program until the operation is complete.
QREAD READ INDECB,SF,INFILE,INBUF,'S'
This example reads one entire block from file identified by the open DCB at INFILE into a buffer identified by INBUF.
READ RDECB5,SF,(*,FILEADDR),(3)
This example reads one block from DCB identified by the indirect S type address constant (*,FILEADDR) into the buffer whose address is held in register 3.