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.1 Effect of CLOSE Statement on File Types



If the SELECT OPTIONAL clause is specified in the FILE-CONTROL entry for a file, and the file is not present at run time, standard end-of-file processing is not performed. For QSAM files, the file position indicator and current volume pointer are unchanged.

Files are divided into the following types:

Non-Reel/Unit
A file whose input or output medium is such that rewinding, reels, and units have no meaning. All VSAM, Btrieve, and STL files are non-reel/unit file types. QSAM files can be non-reel/unit file types.

Sequential Single Volume
A sequential file that is contained entirely on one volume. More than one file can be contained on this volume. All VSAM, Btrieve, and STL files are single volume. QSAM files can be single volume.

Sequential Multivolume
A sequential file that is contained on more than one volume. QSAM files are the only files that can be multivolume. The concept of volume has no meaning for VSAM, Btrieve, or STL files.

The permissible combinations of CLOSE statement phrases are included in:

The meaning of each key letter is shown in Table 40.


 Table 37. Sequential Files and CLOSE Statement Phrases                    
                               
 CLOSE Statement Phrases       
 Non-Reel/ 
 Unit      
 Sequential    
 Single-Volume 
 Sequential    
 Multi-Volume  
 CLOSE                           C           C, G            A, C, G       
 CLOSE REEL/UNIT                 F           F, G            F, G          
RevisionX  CLOSE REEL/UNIT WITH          
RevisionX  NO REWIND                     
RevisionX  F         
RevisionX            
RevisionX  B, F          
RevisionX                
RevisionX  B, F          
RevisionX                
 CLOSE REEL/UNIT FOR REMOVAL     D           D               D             
 CLOSE WITH NO REWIND            C, H        B, C            A, B, C       
 CLOSE WITH LOCK                 C, E        C, E, G         A, C, E, G    



 Table 38. Indexed and Relative File Types and CLOSE Statement Phrases     
 CLOSE Statement Phrases               Action                              
 CLOSE                                 C                                   
 CLOSE WITH LOCK                       C,E                                 



RevisionX  Table 39. Line Sequential File Types and CLOSE Statement Phrases          
RevisionX  CLOSE Statement Phrases              RevisionX  Action                              
RevisionX  CLOSE                                RevisionX  C                                   
RevisionX  CLOSE WITH LOCK                      RevisionX  C,E                                 



 Table 40. Meanings of Key Letters for Sequential File Types               
 Key   Actions Taken                                                       
  A  
     
     
     
     
     
     
     
     
     
 Previous Volumes Unaffected                                         
                                                                     
 Input and Input-Output Files--Standard volume-switch processing is  
 performed for all previous volumes (except those controlled by a    
 previous CLOSE REEL/UNIT statement).  Any subsequent volumes are    
 not processed.                                                      
                                                                     
 Output Files--Standard volume-switch processing is performed for    
 all previous volumes (except those controlled by a previous CLOSE   
 REEL/UNIT statement).                                               
  B  
     
 No Rewinding of Current Reel--the current volume is left in its     
 current position.                                                   
  C  
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
 Close File                                                          
                                                                     
 Input and Input-Output Files--If the file is at its end, and label  
 records are specified, the standard ending label procedure is       
 performed.  Standard system closing procedures are then performed.  
                                                                     
 If the file is at its end, and label records are not specified,     
 label processing does not take place, but standard system closing   
 procedures are performed.                                           
                                                                     
 If the file is not at its end, standard system closing procedures   
 are performed, but there is no ending label processing.             
                                                                     
 Output Files--If label records are specified, standard ending label 
 procedures are performed.  Standard system closing procedures are   
 then performed.                                                     
                                                                     
 If label records are not specified, ending label procedures are not 
 performed, but standard system closing procedures are performed.    
  D    Volume Removal--Treated as a comment.                               
  E  
     
 File Lock--The compiler ensures that this file cannot be opened     
 again during this execution of the object program.                  
  F  
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
 Close Volume                                                        
                                                                     
 Input and Input-Output Files--If the current reel/unit is the last  
 and/or only reel/unit for the file or if the reel is on a           
 non-reel/unit medium, no volume switching is performed.  If another 
 reel/unit exists for the file, the following operations are         
 performed: a volume switch, beginning volume label procedure, and   
 the first record on the new volume is made available for reading.   
 If no data records exist for the current volume, another volume     
 switch occurs.                                                      
                                                                     
 Output (Reel/Unit Media) Files--The following operations are        
 performed:  the ending volume label procedure, a volume switch, and 
 the beginning volume label procedure.  The next executed WRITE      
 statement places the next logical record on the next direct access  
 volume available.  A close statement with the REEL phrase does not  
 close the output file; only an end-of-volume condition occurs.      
                                                                     
 Output (Non-Reel/Unit Media) Files--Execution of the CLOSE          
 statement is considered successful. The file remains in the open    
 mode and no action takes place except that the value of the I-O     
 status associated with the file is updated.                         
  G    Rewind--The current volume is positioned at its physical beginning. 
  H  
     
 Optional Phrases Ignored--The CLOSE statement is executed as if     
 none of the optional phrases were present.                          




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.