IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

File open error 37 for a KSDS VSAM file in OUTPUT mode


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthick Raja

New User


Joined: 10 Aug 2006
Posts: 8

PostPosted: Thu Dec 07, 2006 5:15 pm
Reply with quote

Hi,

When i tried to open a KSDS VSAM file in OUTPUT mode i am getting file open error of 37. the DISP i gave in JCL is OLD and even tried with SHR.
I have given the access mode as DYNAMIC.

This is the piece of code i used for SELECT
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS OUT-ID
----------
----------
PROCEDURE DIVISION.
START-PARA.
DISPLAY 'STARTED'.
OPEN OUTPUT OUTPUT-FILE.

This open statement is causing the error. I have tried with both empty file & with some data. Can any one help me on this.

Thanks in Advance.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Thu Dec 07, 2006 5:49 pm
Reply with quote

file status 37 occurs because of

An OPEN statement was attempted on a file that would not support the open mode specified in the OPEN statement. Possible violations are:
1. The EXTEND or OUTPUT phrase was specified but the file would not support write operations.
2. The I-O phrase was specified but the file would not support the input and output operations permitted.
3. The INPUT phrase was specified but the file would not support read operations.
4. Under VSE, the EXTEND phrase was specified for a SAM file.

note: taken from www.simotime.com/vsmfsk01.htm
Back to top
View user's profile Send private message
karthick Raja

New User


Joined: 10 Aug 2006
Posts: 8

PostPosted: Thu Dec 07, 2006 6:34 pm
Reply with quote

Hi,

Thanks for the reply. But i dont know the reason why i am getting that return code. I suppose the code has work fine.
I didnt find any error in the code.
please correct me if i am wrong.
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Canada

PostPosted: Thu Dec 07, 2006 7:22 pm
Reply with quote

karthick,
If my guess is correct,you might have created the VSAM file and initialized it previously before the program..
Hence if you want to write data into it ,then you should open the file in
I-O mode..

Regards,
Muhuvel.
Back to top
View user's profile Send private message
karthick Raja

New User


Joined: 10 Aug 2006
Posts: 8

PostPosted: Fri Dec 08, 2006 9:40 am
Reply with quote

Hi Muthuvel,

i dont get your explanation. Can you breif me on that please. What do you mean by the file is initialised?
But you are correct. The things are fine when it is opened in I-O mode.
i have checked it previously.
Thanks for your reply.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Dec 08, 2006 11:50 am
Reply with quote

Hi Karthick

Try dropping and recreating the VSAM file.It will be of more help if you can provide us with your VSAM file definition.

Thanks
Arun
Back to top
View user's profile Send private message
hiravibk
Warnings : 1

Active User


Joined: 14 Dec 2008
Posts: 107
Location: India

PostPosted: Fri Nov 27, 2009 9:34 am
Reply with quote

Arun Raj wrote:
Hi Karthick

Try dropping and recreating the VSAM file.It will be of more help if you can provide us with your VSAM file definition.

Thanks
Arun


Arun,
I was facing the same problem and i just droped the vsam and created it again, and now the program works fine. But i dont know how creating teh vsam again affects this. could u plz expalin the logic behind this ??
Thank you
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 27, 2009 10:48 am
Reply with quote

Hello,

Please note that you have posted a reply that has been inactive for almost 3 years. . .

Dropping and re-creating the file can remove any internal inconsistency or corruption. Dropping and re-creating the file also removes any chance of determining what was currently wrong with the file.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Nov 27, 2009 4:28 pm
Reply with quote

Pardon my ignorance (if it is) but does "dropping" really a correct term here in relation with VSAMs? VSAMs are used with DELETE/DEFINEd... one can DROP a table not file... icon_neutral.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 27, 2009 6:39 pm
Reply with quote

Anuj,

being a little picky aren't you?

people say
JCL when they should say JOB or STEP.
PROC when they should say REXX Script.
DROP when they should say delete.

this is more of a chat room than a technical forum.
my guess that a lot of people post here, because their technical co-workers
have had enough of the illiteracy.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Nov 27, 2009 8:27 pm
Reply with quote

Dick,

Yes actually...

First, I started my response with "Being little picky" instead of
Quote:
Pardon my ignorance
but then I thought about the kind of people log-in to this Forum, they are from very diverse backgrounds and the years of experience they have is much more than mine. On the other hand I think if such terminologies are in use at least at a single place even... I may ask more...may be in future I can corelate with those terms if come across again...nothing more than that.

Happy thanksgiving... icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts HILITE on Browse mode? TSO/ISPF 2
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top