OPENDEV


Opens a device (or file) for sequential writing and/or reading.

 

COMMAND SYNTAX

OPENDEV Device TO FileVar { LOCKED statements } THEN | ELSE statements

 

SYNTAX ELEMENTS

Device specifies the target device or file
FileVar contains the file descriptor of the file when the open was successful
Statements conditional jBC statements

 

NOTES

If the device does not exist or cannot be opened then the ELSE clause is executed.  Once open a lock is taken on the device. If the lock cannot be taken then the LOCKED clause is executed if it exists otherwise the ELSE clause is executed. The specified device can be a regular file, 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.

 

EXAMPLE

OPENDEV "\\.\TAPE0" TO tape.drive ELSE STOP

Opens the Windows default tape drive and prepares it for sequential processing.  For more info on sequential processing, see READSEQ, WRITESEQ, or the sequential processing example.


jBC