![]() ![]() |
|
OPENSEQOpens a file for sequential writing and/or reading.
COMMAND SYNTAXOPENSEQ Path{,File} {READONLY} TO FileVar {SETTING setvar} {ON ERROR statements} { LOCKED statements } THEN | ELSE statements
SYNTAX ELEMENTS
If the SETTING clause is specified and the read fails, setvar will be set to one of the following values: Incremental File Errors
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. NOTESIf the file does not exist or cannot be opened then the ELSE clause is executed. However if JBCEMULATE is set for Sequoia (use value "seq") emulation then OPENSEQ will create the file if it does not exist. This behavior can also be achieved by specifying "openseq_creates = true" in Config_EMULATE for the emulation being used. Alternatively, the CREATE statement can be used, which eliminates the need for the 'openseq_creates = true' Config_EMULATE option. Once open a lock is taken on the file. If the lock cannot be taken then the LOCKED clause is executed if it exists otherwise the ELSE clause is executed. If READONLY is specified then the process takes a read lock on the file otherwise a write lock is taken. The specified file can be a regular, pipe or special device file. Locks are only taken on regular file types. Once open the file pointer is set to the first line of sequential data. Sequential Files can be further manipulated with these Sequential File Extensions.
EXAMPLES
|