COBOL/400 Language Help

Format 1 (Sequential Files)

Description
The CLOSE statement terminates the processing of volumes and files, with optional rewind and/or lock or removal, where applicable.

You may execute it only for a file in an open mode. After successful execution of the CLOSE statement without the REEL/UNIT phrase:

Format 1 (Sequential Files Format)
 
          *------------------------------------------------------*
          V                                                      +
->->--CLOSE file-name-1-*------------------------------------------*-----><-
                      **-*-REEL-*----*--------------------*--*---*
                       + *-UNIT-*    *-----*--REMOVAL-----*  +
                       +             *-FOR-*                 +
                       *-*------*-----*-NO REWIND-*----------*
                         *-WITH-*     *-LOCK------*

file-name-1

File-name-1 designates the file upon which the CLOSE statement is to operate. If you specify more than one file-name, the files need not have the same organization or access.

File-name-1 must not be a sort or merge file.

REEL or UNIT

Specify the REEL/UNIT phrases for multivolume or single volume tape files.

The system always rewinds and unloads the tape when you specify REEL/UNIT on the CLOSE statement.

REEL and UNIT are interchangeable.

REMOVAL

The FOR REMOVAL phrase is applicable only to tape files. The current volume is rewound and unloaded. The system is notified that the volume is logically removed from the run unit. However, the volume can be accessed again after a CLOSE operation without the REEL/UNIT phrase, and an OPEN operation for this file.

The system always rewinds and unloads the tape when you specify REEL/UNIT on the CLOSE statement.

NO REWIND

The WITH NO REWIND phrase is applicable only to tape files.

The current volume is left in its present position. The reel is not rewound.

The system always rewinds and unloads the tape when you specify REEL/UNIT on the CLOSE statement.

LOCK

The WITH LOCK phrase ensures that the file cannot be reopened during this processing of the program. The record area associated with the file-name is no longer available after a successful CLOSE operation.


[ Top of Page | Previous Page | Next Page | Table of Contents ]