Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

CLOSE statement

The CLOSE statement dissociates an opened file from its data set.

Read syntax diagramSkip visual syntax diagram            .-,--------------------.
            V                      |
>>-CLOSE--+---FILE(file-reference)-+-+--;----------------------><
          '-FILE(*)------------------'
 
FILE
Specifies the name of the file that is dissociated from the data set. CLOSE FILE(*) closes all open files.

The CLOSE statement also dissociates from the file all attributes established for it by the implicit or explicit opening process. If desired, new attributes can be specified for the file in a subsequent OPEN statement. However, all attributes explicitly given to the file constant in a DECLARE statement remain in effect.

Closing a file that was previously closed has no effect. A closed file can be reopened. If a file is not closed by a CLOSE statement, it is closed at the termination of the program.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)