WEOF statement

Syntax

WEOF [UNIT (mtu) ] {THEN statements [ELSE statements] | 
ELSE statements}

Description

Use the WEOF statement to write an end-of-file (EOF) mark to tape.

The UNIT clause specifies the number of the tape drive unit. Tape unit 0 is used if no unit is specified.

mtu is an expression that evaluates to a three-digit code (decimal). Although the mtu expression is a function of the UNIT clause, the WEOF statement uses only the third digit (the u). Its value must be in the range of 0 through 7 (see the READT statement for details on the mtu expression). If mtu evaluates to the null value, the WEOF statement fails and the program terminates with a run-time error message.

Before a WEOF statement is executed, a tape drive unit must be attached (assigned) to the user. Use the ASSIGN command to assign a tape unit to a user. If no tape unit is attached or if the unit specification is incorrect, the ELSE statements are executed.

The STATUS function returns 1 if WEOF takes the ELSE clause, otherwise it returns 0.

Example

WEOF UNIT(007) ELSE PRINT "OPERATION NOT COMPLETED."