READ (Read a Record) Macro

The READ macro transfers a record or part of a record from an input file to an area in virtual storage.

Do not code a READ macro after a WRITE SQ macro.

Format

Read syntax diagramSkip visual syntax diagramnameREADfilename(1),SQ,area(0), length,( r1),S,ID,KEY,OR,name( r2),DR,name( r3)number, number,MR

Requirements for the caller

AMODE:
24
RMODE:
24
ASC Mode:
Primary

Parameters

filename | (1)
Specifies the name of the file from which the record is to be read. The name is the same as the one you specified in the DTFxx macro for the file.
SQ
Required for sequential work files.
area | (0)
The name of the input area that is used by a sequential file.
length | (r1 )| S
Specifies only sequential files of undefined format (RECFORM=UNDEF). Specifies the actual number of bytes to be read, or the register where the number is to be found. S specifies that the entire record is to be read. The length of the record is taken from the filenameL field of the DTF.
ID
Applies to DAM. Specifies that the reference is to be by ID (identifier in the count area of the record).
KEY
For ISAM, KEY is required. For DAM, KEY specifies that the record reference is to be by record key (control information in the key area of the DASD record).