The BACKSPACE statement positions a sequential file at the beginning of the preceding record, making it available for subsequent I/O processing. It takes one of the following forms:
Rules and Behavior
The I/O unit number must specify an open file on disk or magnetic tape.
A BACKSPACE statement must not be specified for a file that is open for direct, append, or keyed access, because record n is not available to the RMS I/O system.
If a file is already positioned at the beginning of a file, a BACKSPACE statement has no effect.
The following statement repositions the file connected to I/O unit 4 back to the preceding record:
Consider the following statement:
BACKSPACE (UNIT=9, IOSTAT=IOS, ERR=10)
This statement positions the file connected to unit 9 back to the preceding record. If an error occurs, control is transferred to the statement labeled 10, and a positive integer is stored in variable IOS.
For More Information: