Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 10: File processing


FILE STATUS CODES

  • FILE STATUS codes are checked in program to ensure last I-O is successful.
  • It is two-byte in length and can be capture using working storage item defined as PIC X(2).
  • The first byte indicates the general category whereas second byte indicates the specific type of error message under that category

Code Description
First Byte Second byte
0   Successful OPEN/READ/WRITE operation
  0 Successful Completion
  2 A duplicate Key condition exists, this is alright since this condition exists only when DUPLICATES has been specified for an AIX
  4 Invalid fixed length record
  5 While performing OPEN File and file is not present
1   When AT END condition encounters
  0 End of File encountered
  4 Attempted to READ a relative record outside file boundary
2   When INDEX key related error encounters
  0 Invalid Key for KSDS or RRDS
  1 Out of sequence condition during sequential insertion
  2 A duplicate key condition exists, no duplicates are allowed
  3 No record found
  4 KSDS/RRDS boundary violation, SHR (4 4)
3   Permanent Open Error
  0 Input/Output physical error
  4 ESDS boundary violation, SHR (4 4)
  5 While performing OPEN File and file is not present
  7 OPEN file with wrong mode
  8 Tried to OPEN a Locked file
  9 OPEN failed because of conflicting file attributes.
4   Logic error in OPEN/CLOSE/REWRITE
  1 Tried to OPEN a file that is already open
  2 Tried to CLOSE a file that is not OPEN
  3 Tried to REWRITE without READing a record first
  4 Tried to REWRITE a record of a different length
  6 Tried to READ beyond End-of-file
  7 Tried to READ from a file that was not opened I-O or INPUT
  8 Tried to WRITE to a file that was not opened I-O or OUTPUT
  9 Tried to DELETE or REWRITE to a file that was not opened I-O
9   Implementation defined
  0 Error condition, catch all if error does not fit category above
  1 Password or authorization failed
  2 Logical error, usually out of sequence commands, sometimes invalid operation for file type, trying to read from an output file, etc.
  3 Resource not available
  4 No pointer supplied for sequential operation
  5 Invalid/incomplete file information
  6 No file identification
  7 OPEN successful and file integrity verified
  8 File is Locked - OPEN failed
  9 Record Locked - Record access failed





© copyright mainframebug.com
Privacy Policy