View previous topic :: View next topic
|
Author |
Message |
naveen_kj
New User
Joined: 18 Aug 2003 Posts: 2
|
|
|
|
Hi,
I have a new VSAM file created. In the program the VSAM file is opening in the input mode. When the program is executed, it is giving file-status "35" for opening of VSAM file.
I created a temporary record in the VSAM file using a simple program (open in output and close). But still it gave file-status 35 for open.
I inserted a blank record and executed the program, it executed successfully.
I want know, how to initialize the vsam file in the program to avoid this file-status 35 for open in input mode?
The initialization of VSAM file can be done through a JCL, before the execution of the program?
Thanks in advance,
Naveen |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
You may get file status 35 when you try to open a NON-OPTIONAL or UNAVAILABLE file in INPUT/EXTEND Mode. |
|
Back to top |
|
|
naveen_kj
New User
Joined: 18 Aug 2003 Posts: 2
|
|
|
|
Millan,
Thanks for your reply.
In my program, the VSAM file has to be opened in input mode.
Is there any solution for this other than inserting a blank record before the execution of the program.
Naveen |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Yes, you can use OPTIONAL phrase on Select clause.
Better to check the file status before opening the file itself to avoid status errors.
Code: |
OPEN INOUT <filename>.
IF <filestatus> = "35" OPEN OUTPUT <filename> |
|
|
Back to top |
|
|
|