Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.6 CLOSE Statement



The CLOSE statement terminates the processing of volumes and files.


    ___ Format 1--Sequential _______________________________________________ 
   |                                                                        |
   |            <____________________________________________________       |
   | >>__CLOSE____file-name-1__ ___________________________________ _|___>< |
   |                           |        (1)                        |        |
   |                           |_ _REEL____ __ __________________ _|        |
   |                           | |      (1)|  |_ _____ __REMOVAL_| |        |
   |                           | |_UNIT____|  | |_FOR_|          | |        |
   |                           |              |_ WITH NO REWIND _| |        |
   |                           |                       (1)         |        |
   |                           |_ ______ __ _NO REWIND____ ________|        |
   |                             |_WITH_|  |_LOCK_________|                 |
   |                                                                        |
   | Note:                                                                  |
   | (1)  Under OS/390, the REEL, UNIT, and NO REWIND phrases are not valid |
   |      for VSAM files.  Under AIX, OS/2, and Windows, the UNIT, REEL,    |
   |      and NO REWIND phases are treated as a comment.  Although, the     |
   |      file status will be set to 07, indicating a successful completion |
   |      of a CLOSE for a non-reel/unit medium.                            |
   |                                                                        |
   |________________________________________________________________________|


    ___ Format 2--Indexed and Relative Files _______________________________ 
   |                                                                        |
   |            <_________________________________                          |
   | >>__CLOSE____file-name-1__ ________________ _|______________________>< |
   |                           |_ ______ __LOCK_|                           |
   |                             |_WITH_|                                   |
   |                                                                        |
   |________________________________________________________________________|

 X  ___ Format 3--Line Sequential Files (Workstation Only) _________________ 
 X |                                                                        |
 X |            <____________________________________________________       |
 X | >>__CLOSE____file-name-1__ ___________________________________ _|___>< |
 X |                           |        (1)                        |        |
 X |                           |_ _REEL____ __ __________________ _|        |
 X |                           | |      (1)|  |_ _____ __REMOVAL_| |        |
 X |                           | |_UNIT____|  | |_FOR_|          | |        |
 X |                           |              |_WITH NO REWIND___| |        |
 X |                           |                       (1)         |        |
 X |                           |_ ______ __ _NO REWIND____ ________|        |
 X |                             |_WITH_|  |_LOCK_________|                 |
   |                                                                        |
 X | Note:                                                                  |
 X | (1)  Under AIX, OS/2, and Windows, the UNIT, REEL, and NO REWIND       |
 X |      phases are treated as a comment.  Although, the file status will  |
 X |      be set to 07, indicating a successful completion of a CLOSE for a |
 X |      non-reel/unit medium.                                             |
   |                                                                        |
   |________________________________________________________________________|

file-name-1
Designates the file upon which the CLOSE statement is to operate. If more than one file-name is specified, the files need not have the same organization or access. File-name-1 must not be a sort or merge file.

REEL/UNIT
Under OS/390 and VM, you can specify these phrases only for QSAM multivolume or single volume files. The terms REEL and UNIT are interchangeable.

Under AIX, OS/2, and Windows, REEL and UNIT are treated as comments.

WITH NO REWIND and FOR REMOVAL
Under OS/390 and VM, these phrases apply only to QSAM tape files. If they are specified for storage devices to which they do not apply, they are ignored.

Under AIX, OS/2, and Windows, WITH NO REWIND and FOR REMOVAL are treated as comments.

A CLOSE statement can be executed only for a file in an open mode. After successful execution of a CLOSE statement (without the REEL/UNIT phrase if using format 1):

If the FILE STATUS clause is specified in the FILE-CONTROL entry, the associated status key is updated when the CLOSE statement is executed.

If the file is in an open status and the execution of a CLOSE statement is unsuccessful, the EXCEPTION/ERROR procedure (if specified) for this file is executed.

Subtopics:



Previous Topic Next Topic Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.