READ
Reads a file and returns the next record in the file.
Note: On mainframe systems, Enrichment opens READ files in binary mode. To open files in text mode, as was done prior to version 6.6.2, rename or copy the distributed load module EOEFLAG0 to EOEFLAG1. This is equivalent to using the run-time argument /Y.
Syntax
READ(filename,[recordlen])
Argument
Argument | Description | Default |
---|---|---|
filename | The file you want to read. filename may be up to 255 characters in length. | None |
[recordlen] | The record length in bytes of the file to be read. If the record length is shorter than the recordlen specified, it will be padded with blanks. If the record length is longer than the recordlen specified, it will be truncated. | 1024 |
Results
Result | Description | |
---|---|---|
Return | Returns the current record from filename. | |
%%RC | One of the following: | |
%%RC | 0 | No error. |
1 | Record truncation occurred. | |
2 | End of file or I/O error. | |
Error opening file. | ||
%%RM | A null string (''). | |
%%RV | The record number of the record that was read. |
Examples
Function Call | Return | %%RC | %%RV |
---|---|---|---|
READ(dd:input1) | Account # 11111111 | 0 | 5 |