Effects on Designated Files

If the file is a magnetic tape file, it is rewound. For disk files, the record pointer is set to the first record of the file. For more information on the file designator option, see SWITCH FILE Declaration.

Line printer units are released from program control. When the REWIND statement is used for a magnetic tape file that is positioned past the first reel of a multireel file, the second and subsequent reels are released from program control. Other kinds of units remain under program control. A REWIND statement that leaves a file under program control is referred to as a "close with retention." For more information, refer to the I/O Subsystem Programming Guide.

For random access files, if the file is to be reused immediately, the statement SEEK(<file designator>[0]) positions the file at its first record while avoiding the overhead of closing the file and then reopening it. For more information, refer to SEEK Statement.