|
View previous topic :: View next topic
|
| Author |
Message |
nileshyp
New User
.jpg)
Joined: 22 Jun 2005 Posts: 65 Location: Mumbai
|
|
|
|
My COBOL program is abending as I am getting file status code of 35 in called program. When I checked the file looks to be present. I am not sure why
I am not sure why i am getting the error as dataset is also opened as INPUT in called program which is perfectly alright.
Kindly advise if there is any workaround.
explained above scenario in detail as below :
My program is PROG A
PROG A calling PROG B for getting some info
PROG B has dataset called "ACTRNGIP"
When I run my program ie. PROG A
I get below error display
"ACTRNGIP - OPEN PROBLEM FILE STATUS = 35" |
|
| Back to top |
|
 |
sureshmanokar
New User
.jpg)
Joined: 21 Dec 2010 Posts: 11 Location: Bangalore
|
|
|
|
Is it a VSAM file? If it is a VSAM the file may be EMPTY. The File status will be '35' even if the program tries to access a empty file.
Possible Causes:
File Not Found: The file you are trying to open does not exist in the specified location.
Empty File (Relative File): For relative files, if the file exists but is empty, it may also return a status code 35.
Scenarios:
OPEN I-O: When attempting to open a file for input-output operations (I-O) and the file does not exist.
OPEN INPUT: When attempting to open a file for input operations (INPUT) and the file does not exist.
OPEN EXTEND: When attempting to open a file for extend operations (EXTEND) and the file does not exist.
Handling the Error:
Check File Existence: Before attempting to open the file, you might check if the file exists using system commands or file utilities available in your environment.
Create the File: If the file does not exist, you can create it before attempting to open it again.
Error Handling: Implement appropriate error handling and user notification in your COBOL program to manage file status code 35 effectively. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
File Status Codes
| Quote: |
An OPEN statement with the INPUT, I-O, or EXTEND phrase was attempted on a non-optional file that was not present.
|
you tried to open an file that does not exist.
simple as that.
proof your
jcl dd statements,
or if you are using dynamic allocation
check on your file name parm.
I don't think you will get a 35 on an open for an empty vsam.
you will probably recieve an error on a read of an empty vsam. |
|
| Back to top |
|
 |
sureshmanokar
New User
.jpg)
Joined: 21 Dec 2010 Posts: 11 Location: Bangalore
|
|
|
|
Yeah, i accept it. I thought he may be correct eith the DD name.
FILE STATUS 35:-
ATEMPTING TO OPEN AN EMPTY FILE IN INPUT OR I/O MODE. DD NAME
IS MISSING OR WRONGLY GIVEN.
Explanation: This file status code indicates that the program attempted to access a file using a mode (e.g., open, close, read, write) that is not permitted or invalid for the file or file organization.
Possible Causes:
Invalid Open Mode: Trying to open a file in a mode that is not allowed for that file, such as opening a file for output only when it should be opened for input.
Invalid Close Mode: Attempting to close a file in a mode that is not supported, such as trying to close an input file with a CLOSE OUTPUT statement.
Invalid Read/Write Mode: Using READ or WRITE statements with an invalid mode, such as trying to write to a file opened only for input.
Resolving File Status Code 35
To resolve file status code 35, ensure that your file access operations (OPEN, READ, WRITE, CLOSE, etc.) are aligned with the file's intended mode of use as specified in your COBOL program. Here are some steps you can take:
Check File Definitions: Review the FD (File Description) entries in your COBOL program to ensure that the file modes (INPUT, OUTPUT, I-O) match the intended file access operations.
Verify OPEN Statements: Double-check your OPEN statements to ensure that you are opening files in the correct mode (INPUT, OUTPUT, I-O) based on how they are used in subsequent READ, WRITE, or CLOSE statements.
Review READ/WRITE Statements: Make sure that READ statements are used with files opened for input, and WRITE statements are used with files opened for output.
Close Files Appropriately: Use CLOSE statements with the correct mode (INPUT, OUTPUT) corresponding to how the file was opened. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|