READC (Read Next Changed Record)
Free-Form Syntax | READC{(E)} record-name {data-structure} |
Code | Factor 1 | Factor 2 | Result Field | Indicators | ||
---|---|---|---|---|---|---|
READC (E) | record-name | data structure | _ | ER | EOF |
The READC operation can be used only with an externally described WORKSTN file to obtain the next changed record in a subfile. The record-name operand is required and must be the name of a record format defined as a subfile by the SFILE keyword on the file description specifications. (See SFILE(recformat:rrnfield) for information on the SFILE keyword.)
For a multiple device file, data is read from the subfile record associated with a program device; the program device is identified by the field specified in the DEVID keyword on the file specifications. If there is no such entry, data is read from the program device used for the last successful input operation.
To handle READC exceptions (file status codes greater than 1000), either the operation code extender 'E' or an error indicator ER can be specified, but not both. For more information on error handling, see File Exception/Errors.
You can specify an indicator in positions 75-76 that will be set on when there are no more changed records in the subfile. This information can also be obtained from the %EOF built-in function, which returns '1' if there are no more changed records in the subfile and '0' otherwise.
If the data-structure operand is specified, the record is read directly into the data structure. The data structure must be a data structure defined with EXTNAME(...:*INPUT or *ALL) or LIKEREC(...:*INPUT or *ALL). See File Operations for information on how to define the data structure and how data is transferred between the file and the data structure.