This is very common error in VSAM files. The below are the reasons and resolution for OPEN error (File status code is 35).
Opening a file (ESDS, KSDS, or RRDS)
Before you can use WRITE, START, READ, REWRITE, or DELETE statements to process records in a file, you must first open the file with an OPEN statement.
File availability and creation affect OPEN processing, optional files, and file status codes 05 and 35. For example, if you open a file that is neither optional nor available in EXTEND, I-O, or INPUT mode, you get file status 35 and the OPEN statement fails. If the file is OPTIONAL, the same OPEN statement creates the file and returns file status 05.
An OPEN operation works successfully only when you
set fixed file attributes in the DD statement or data-set label for a file and specify consistent attributes for the file in the SELECT clause and FD entries of your COBOL program.
Resolution and Check in the Program
Mismatches in the following items result in a file status code 39 and the failure of the OPEN statement:
- Attributes for file organization (sequential, relative, or indexed)
- Prime record key
- Alternate record keys
- Maximum record size
- Record type (fixed or variable)
- How you code the OPEN statement for a VSAM file depends on whether the file is empty (a file that has never contained records) or loaded.
- For either type of file, your program should check the file status key after each OPEN statement.