REWIND statement

Syntax

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

Description

Use the REWIND statement to rewind a magnetic tape to the beginning-of-tape position.

The UNIT clause specifies the number of the tape drive unit. Tape unit 0 is used if no unit is specified. If the UNIT clause is used, mtu is an expression that evaluates to a code made up of three decimal digits. Although the mtu expression is a function of the UNIT clause, the REWIND statement uses only the third digit (the u). Its value must be in the range of 0 through 7. If mtu evaluates to the null value, the REWIND statement fails and the program terminates with a run-time error message.

Before a REWIND statement is executed, a tape drive unit must be attached 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 REWIND takes the ELSE clause, otherwise it returns 0.

PIOPEN Flavor

If you have a program that specifies the syntax UNIT ndmtu, the nd elements are ignored by the compiler and no errors are reported.

Example

REWIND UNIT(002) ELSE PRINT "UNIT NOT ATTACHED"