OPEN errors occur frequently with VAM files . Below are the reasons and resolutions for the 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.
Whether a file is available or optional affects OPEN
processing, file creation, and the resulting file status key.
For example, if you open in EXTEND
, I-O
, or INPUT
mode a nonexistent non-OPTIONAL
file, the result is an OPEN
error, and file status 35 is returned. If the file is OPTIONAL
, however, the same OPEN
statement returns file status 05, and, for open modes EXTEND
and I-O
, creates the file.
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.
VSAM OPEN Error 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)
Additional Points
- Add file status check before you write the logic for VSAM OPEN statement.
- A file can be empty or loaded, for both types, check file status after the OPEN statement.
Related Posts
Learn finance courses
Get more knowledge on finance topics. That helps you for personal life and career.