Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
READ—Read a block (BPAM and BSAM) z/OS DFSMS Macro Instructions for Data Sets SC23-6852-02 |
||||
The READ macro retrieves a block from a data set and places it in a designated area of storage (input area). Control might be returned to the problem program before the block is retrieved. The input operation must be tested for completion using a CHECK, WAIT or EVENTS macro. After completion, you can determine the length of the block by using a technique described in z/OS DFSMS Using Data Sets. If you are using the large block interface (OPEN set DCBESLBI on) for fixed-length blocked or undefined-length records, the actual length of the record block that was read can be found in a 4-byte length-read field. Locate the length-read field by performing the following tasks:
A data event control block, shown in Status information following an input/output operation, is constructed as part of the macro expansion. If the OPEN macro specifies UPDAT, both the READ and WRITE macros must refer to the same data event control block. See the list form of the READ or WRITE macro for a description of how to construct a data event control block. See the execute form of the READ or WRITE macro for a description of how to modify an existing data event control block. Data Conversion: For BSAM, you can request conversion by
coding LABEL=(,AL) or (,AUL) in the DD statement, or by coding OPTCD=Q
in the DCB macro or DCB subparameter of the DD statement. If conversion
is requested, the check routine automatically converts BSAM records,
as they are read, from one character representation to another if
the record format is F, FB, D, DB, or U. Conversion occurs when the
check routine determines that the input buffer is full. Conversion
is performed according to one of the following techniques:
Refer to z/OS DFSMS Using Data Sets, for a complete description of CCSID conversion and Default Character conversion. Reading a PDSE directory: When reading the PDSE directory, end-of-file is indicated after the last of the directory data is read. Empty directory blocks are not simulated. UNIX files: For a UNIX file processed with RECFM=VB, each READ returns one record per block. Extended format data sets: On READ requests for extended format data sets, that are not in the compressed format, you must provide a data area at least the size of DCBBLKSI or DCBEBLKSI unless you are reading format-U records and code a length on the READ macro. In that case, the data area must be at least the length coded. Compressed format data sets: When processing a compressed format data set and NOTE/POINT is specified in the DCB (MACRF=P), a READ issued for a block whose user RBN value exceeds 16 777 215 will result in an I/O error. This is due to the fact that the NOTE/POINT interface is limited by a 3 byte token. Addressing mode: When you issue the READ macro in 24-bit mode, provide only 24-bit addresses unless you code SF64 or SF64P. When you issue the READ macro in 31-bit addressing mode, provide only 31-bit addresses unless documentation says otherwise or you code SF64 or SF64P. With SF64 or SF64P, the data area can reside above the 2 GB bar but you cannot issue READ in 64-bit mode. BSAM and BPAM allow data areas to be located above the 16MB line. This includes allowing the caller to issue some other BPAM and BSAM macros in 31-bit addressing mode regardless of whether the data area is above or below the 16MB line. Most types of data sets support 31-bit mode. The standard form of READ must be issued from a program that resides below the 16MB line because the DECB must reside below the line. To take advantage of providing data areas above the 16 MB line for BSAM macros, the issuer of the READ macro must execute in 31-bit addressing mode. Syntax: The standard form of the READ macro is written as follows (the list and execute forms are shown following the descriptions of the standard form instructions):
|
Copyright IBM Corporation 1990, 2014
|