Read from a file opened for sequential access.



READSEQ Variable FROM FileVar {SETTING setvar} {ON ERROR statements} THEN | ELSE statements



Variable specifies the variable to contain next record from sequential file.
FileVar specifies the file descriptor of the file opened for sequential access.
SETTING if specified and the read fails, setvar will be set to one of the values in the 'Incremental File Errors' table below.
ON ERROR statements are executed upon any error condition, i.e. the READSEQ fails (this is usually used in conjuction with the SETTING clause)
Statements conditional jBC statements

Incremental File Errors

128 No such file or directory
4096 Network error
24576 Permission denied
32768 Physical I/O error or unknown error

If ON ERROR is specified, the statements following the ON ERROR clause will be executed for any of the above Incremental File Errors except error 128.



Each READSEQ reads a line of data from the sequentially opened file. After each READSEQ the file pointer moves forward to the next line of data. The variable contains the line of data less the new line character from the sequential file.

The default buffer size for a READSEQ is 1024 bytes. This can be changed using the IOCTL() function with the JIOCTL_COMMAND_SEQ_CHANGE_RECORDSIZE Sequential File Extensions.