For sequential access, the READ statement makes available the next
 
                  		 or previous
 or previous 
                     		 
                  	 
               
logical record from a file. For random access, the READ statement makes available a specified record from a mass storage file.

 
 
               



 This restriction is removed.
 This restriction is removed. 
                        		
                     
The storage area associated with identifier and the storage area which is the record area associated with file-name must not be the same storage area.


 Identifier can be a floating-point data item.
 Identifier can be a floating-point data item. 
                     	 
                  

 This rule is not enforced.
 This rule is not enforced. 
                        		
                     

 Identifier must not be a dynamic-length group item or a dynamic-length elementary item.
 Identifier must not be a dynamic-length group item or a dynamic-length elementary item. 
                     	 
                   The WITH LOCK phrase can be included only when single records are being locked manually in a shareable file.
 The WITH LOCK phrase can be included only when single records are being locked manually in a shareable file. 
                     	 
                   The WITH NO LOCK phrase is only allowed when records are being locked manually or automatically in a shareable file.
 The WITH NO LOCK phrase is only allowed when records are being locked manually or automatically in a shareable file. 
                     	 
                   
                        		   or PREVIOUS
 or PREVIOUS 
                           		   
                        		
                     
phrases must be specified for files in dynamic access mode when records are to be retrieved sequentially.
 The WITH KEPT LOCK phrase can be included only when multiple records are being locked manually in a shareable file.
 The WITH KEPT LOCK phrase can be included only when multiple records are being locked manually in a shareable file. 
                     	 
                   
                        		  
 or split-key-name
 or split-key-name 
                        		
                     
must be the name of a data item specified as a record key associated with file-name.

 Data-name may also be a redefinition of a data-item specified as a record key associated with a file-name, provided the data-name
                        has the same length as that data-item.
 Data-name may also be a redefinition of a data-item specified as a record key associated with a file-name, provided the data-name
                        has the same length as that data-item. 
                        		
                     
 The redefinition may have a different length from the record key.
 The redefinition may have a different length from the record key. 
                        		
                     
 
                        		  
 or split-key-name
 or split-key-name 
                        		
                     
 Split-key-name is a concatenation of one or more data items specified as a record key associated with file-name.
 Split-key-name is a concatenation of one or more data items specified as a record key associated with file-name. 
                     	 
                   When the AT END condition occurs, the execution of the READ statement is unsuccessful.
 When the AT END condition occurs, the execution of the READ statement is unsuccessful. 
                              			 
                           
 If the file position indicator was positioned by the execution of the OPEN statement, the record pointed to by the file position
                           indicator is made available.
 If the file position indicator was positioned by the execution of the OPEN statement, the record pointed to by the file position
                           indicator is made available. 
                           		  
                         If the file position indicator was positioned by the execution of a previous READ statement, the file position indicator is
                              updated to point to the next existing record in the file, and that record is made available.
 If the file position indicator was positioned by the execution of a previous READ statement, the file position indicator is
                              updated to point to the next existing record in the file, and that record is made available. 
                              			  
                           			 
                            However if the previous statement was a READ, and if that READ returned a locked record status, the file position indicator
                              is left unchanged. The record pointed to by the file position indicator is made available.
 However if the previous statement was a READ, and if that READ returned a locked record status, the file position indicator
                              is left unchanged. The record pointed to by the file position indicator is made available. 
                              			 
                           
 For files opened for INPUT, the READ, READ WITH LOCK or READ WITH KEPT LOCK statements do not acquire a record lock.
  For files opened for INPUT, the READ, READ WITH LOCK or READ WITH KEPT LOCK statements do not acquire a record lock. 
                     	 
                   Two or more run units can share a sequential output file by opening it EXTEND with AUTOMATIC or MANUAL record locking. Records
                     that are appended to the file are in unspecified order.
 Two or more run units can share a sequential output file by opening it EXTEND with AUTOMATIC or MANUAL record locking. Records
                     that are appended to the file are in unspecified order. 
                     	 
                   For files opened for I/O:
 For files opened for I/O: 
                     		
                      If an end-of-file status occurs on a READ statement in a file opened for I/O or INPUT by one run unit and opened EXTEND by
                     another run unit, the run unit that attempted the READ must close the file. This run unit has no access to the appended records
                     because the status remains end-of-file.
  If an end-of-file status occurs on a READ statement in a file opened for I/O or INPUT by one run unit and opened EXTEND by
                     another run unit, the run unit that attempted the READ must close the file. This run unit has no access to the appended records
                     because the status remains end-of-file. 
                     	 
                   
                        		   sequential files or
 sequential files or 
                           		   
                        		
                     
files in sequential access mode, the NEXT phrase is optional and has no effect on the execution of the READ statement.
 Following a READ which encounters a locked record status, the file position indicator points at the locked record. A subsequent
                     READ NEXT or READ PREVIOUS will retrieve the same record again.
 Following a READ which encounters a locked record status, the file position indicator points at the locked record. A subsequent
                     READ NEXT or READ PREVIOUS will retrieve the same record again. 
                     		
                     The NOT AT END phrase is only executed following successful completion of the operation.
 If when a READ statement with the PREVIOUS option is executed no previous logical record exists in the file, the AT END condition
                     occurs, and the execution of the READ statement is considered unsuccessful.
 If when a READ statement with the PREVIOUS option is executed no previous logical record exists in the file, the AT END condition
                     occurs, and the execution of the READ statement is considered unsuccessful. 
                     	 
                   
                        		   the next Format 3 READ statement, if any, executed for that file must be a READ NEXT statement, if AT END occurred because
                           no previous logical record existed. Otherwise
 the next Format 3 READ statement, if any, executed for that file must be a READ NEXT statement, if AT END occurred because
                           no previous logical record existed. Otherwise 
                           		   
                        		
                     
the AT END condition must be followed by:
 
                        		   as described in General Rule 8.
 as described in General Rule 8. 
                           		   
                        		
                     
 If the file position indicator was positioned by the execution of an OPEN statement, and the PREVIOUS option is specified,
                           the AT END condition occurs. Otherwise
  If the file position indicator was positioned by the execution of an OPEN statement, and the PREVIOUS option is specified,
                           the AT END condition occurs. Otherwise 
                           			 
                           if the file position indicator was positioned by the execution of the START or OPEN statement and the record is still accessible through the path indicated by the file position indicator, the record pointed to by the file position indicator is made available. If the record is no longer accessible, which can have been caused for a relative file by deletion of the record, or for an indexed file by a change in an alternate key, the file position indicator is updated to point to the next
 
                              				 or, if the PREVIOUS option is specified, the previous
 or, if the PREVIOUS option is specified, the previous 
                                 				 
                              			 
                           
existing record within the established key of reference, and that record is then made available.
 
                              				 or, if the PREVIOUS option is specified, the previous
 or, if the PREVIOUS option is specified, the previous 
                                 				 
                              			 
                           
existing record in the file.
 However, if the previous statement was a READ, and if that READ returned a locked record status, the file position indicator
                              is left unchanged. The record pointed to by the file position indicator is made available.
 However, if the previous statement was a READ, and if that READ returned a locked record status, the file position indicator
                              is left unchanged. The record pointed to by the file position indicator is made available. 
                              			 
                           
 If the lock mode is MANUAL with single record locking and the referenced file is opened I/O, the run unit acquires a record
                     lock on the record only if the WITH LOCK phrase is specified. A simple READ statement does not acquire a record lock. To read
                     past a locked record the file position indicator should be updated using the START statement. This, however, cannot be used
                     on alternate keys which allow duplicates.
 If the lock mode is MANUAL with single record locking and the referenced file is opened I/O, the run unit acquires a record
                     lock on the record only if the WITH LOCK phrase is specified. A simple READ statement does not acquire a record lock. To read
                     past a locked record the file position indicator should be updated using the START statement. This, however, cannot be used
                     on alternate keys which allow duplicates. 
                     	 
                   If the lock mode is MANUAL with multiple record locking and the referenced file is opened I/O, the run unit acquires a lock
                     on the record only if the WITH KEPT LOCK phrase is specified. A simple READ statement does not acquire a record lock. To read
                     past a locked record the file position indicator should be updated using the START statement. This, however, cannot be used
                     on alternate keys which allow duplicates.
 If the lock mode is MANUAL with multiple record locking and the referenced file is opened I/O, the run unit acquires a lock
                     on the record only if the WITH KEPT LOCK phrase is specified. A simple READ statement does not acquire a record lock. To read
                     past a locked record the file position indicator should be updated using the START statement. This, however, cannot be used
                     on alternate keys which allow duplicates. 
                     	 
                   The WITH WAIT phrase ensures the READ operation is retried repeatedly until the record is available, which is equivalent
                     to setting the RETRYLOCK option.
  The WITH WAIT phrase ensures the READ operation is retried repeatedly until the record is available, which is equivalent
                     to setting the RETRYLOCK option. 
                     	 
                   The IGNORE LOCK phrase causes the READ to proceed as if the record were not locked.
 The IGNORE LOCK phrase causes the READ to proceed as if the record were not locked. 
                     	 
                   
                        		  
 or split-key-name
 or split-key-name 
                           		   
                        		
                     
is established as the key of reference for this retrieval. If dynamic access mode is specified, this key of reference is also used for retrievals by any subsequent executions of Format 3 READ statements for the file until a different key of reference is established for the file.