Monday, 28 July 2014

COBOL File Status Code.

FILE STATUS clause can be used with both sequential and Index file. The following are possible values that may be placed in the FILE STATUS field when an input or output operation is performed. 

Note : If the leftmost character in the FILE STATUS is a 0, the input or output operation was successfully completed. If it is not zero, then the I/O operation result in an error. 

FILE STATUS field after an Input or Output operation

Description
                     Successful Completion of I/O Operation.



       *00
        *02
          04

  • Successful completion - no error occurred. 
  • The record being processed has a duplicate alternate record key.
  • A READ statement has been successfully completed, but the length of the record does not conform to the File Description specifications.
                          Unsuccessful Completion of I/O Operation.
       
       *10
  • A sequential READ statement (READ…AT END) has been attempted, but there are no more input records.
   
       *21
  • A sequence error has occurred - keys are not in the correct order
        
       *22
  • An attempt was made to write a record that would create a duplicate primary record key.

       *23
        *24

  • The required record was not found during a READ.
  • A boundary error has occurred - an attempt has been made to write beyond the pre-established boundaries of an indexed file as established by the operating system.
     
       *30
  • A permanent date error has occurred (this is a hardware problem.)

         34
  • A boundary error for a sequential file has occurred.
         
         
         37
  • A permanent error has occurred because an OPEN statement has been attempted on a file that will not support the mode specified in the OPEN statement (e.g., an indexed file is opened as OUTPUT when ACCESS IS RANDOM has been specified, or a print file is opened as I-O).

          41
  • An OPEN statement has been attempted on a file that is already open

          42
  • A CLOSE statement has been attempted on a file that has not been opened.


          *43
  • An attempt has been made to DELETE or REWRITE a record after an unsuccessful READ (e.g., there is no record in storage to delete or rewrite).
   
           9X
  • Codes of 91-99 are implementation specific - consult your user's manual.

Note: * Indicates that codes applies to index/relatives files.


Created with Artisteer

No comments:

Post a comment