Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
VSAM FILE STATUS 37 when open a vsam file in write mode

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
Author Message
som_infotech

New User


Joined: 25 Feb 2006
Posts: 22
Location: chennai-india

PostPosted: Wed Aug 16, 2006 12:01 pm    Post subject: VSAM FILE STATUS 37 when open a vsam file in write mode
Reply with quote

when i am trying to open a vsam file in write mode its giving me File staus code 37.
Back to top
View user's profile Send private message
References
PostPosted: Wed Aug 16, 2006 12:01 pm    Post subject: Re: VSAM FILE STATUS 37 when open a vsam file in write mode Reply with quote

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3001
Location: Charlotte,NC USA

PostPosted: Wed Aug 16, 2006 12:27 pm    Post subject: Re: VSAM FILE STATUS 37
Reply with quote

"An OPEN operation has been tried on a file which does not support the open mode specified in the OPEN statement."

You are opening what kind of VSAM file in what mode?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 3001
Location: Charlotte,NC USA

PostPosted: Fri Aug 18, 2006 1:07 am    Post subject: Re: VSAM FILE STATUS 37
Reply with quote

A Private Message from the O/P indicates that the file is KSDS and is being opened for OUTPUT.

There is only one other post in this Forum for the same topic, and unfortunatley, it appears that a solution was never identified. Google searches keep indicating that this means that the file cannot be opened or is not available for a WRITE process.
Back to top
View user's profile Send private message
pattabiraman.baskaran

New User


Joined: 10 Aug 2006
Posts: 24

PostPosted: Fri Aug 18, 2006 9:02 am    Post subject:
Reply with quote

There is a solution for this.
Every VSAM file has an RBA value assigned to it. If the VSAM file is new and if it is opened for first time to perform write operation, then it throws an file status 37.
To overcome this open the VSAM file in I-O mode, immediately close it and again open it in OUTPUT mode. By doing so, an RBA value will be assigned to the VSAM file. Now it will work fine.
Code:

OPEN I-O   POLICY-MASTER-FILE.
DISPLAY 'FILE STATUS 4 OPENING PMF VSAM FILE ' PMF-FS.
CLOSE POLICY-MASTER-FILE.
OPEN OUTPUT POLICY-MASTER-FILE.
DISPLAY 'FILE STATUS 4 OPENING PMF VSAM FILE ' PMF-FS.

Please correct me if i am wrong. icon_biggrin.gif
Back to top
View user's profile Send private message
silentarya

New User


Joined: 11 Mar 2007
Posts: 12
Location: Chennai

PostPosted: Mon May 12, 2008 4:57 pm    Post subject: Reply to: VSAM FILE STATUS 37
Reply with quote

Hi,

Just went thru this article today ...

We can also use i-o mode instead of output mode and start working. It went fine with me ... You guyz can also try ...

Code
------
OPEN OUTPUT FILE1.
DISPLAY 'FILE STATUS :' FS1.
MOVE 3 TO RNO.
MOVE 'PUPU' TO NAM.
MOVE 'XYZDEF' TO DEPT.
WRITE REC1.
DISPLAY 'FILE STATUS :' FS1.
CLOSE FILE1.

Output
---------------
FILE STATUS :37
FILE STATUS :48

New Code
------------
OPEN I-O FILE1.
DISPLAY 'FILE STATUS :' FS1.
MOVE 3 TO RNO.
MOVE 'PUPU' TO NAM.
MOVE 'XYZDEF' TO DEPT.
WRITE REC1.
DISPLAY 'FILE STATUS :' FS1.
CLOSE FILE1.

New Output
-------------

FILE STATUS :00
FILE STATUS :00
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1470

PostPosted: Mon May 12, 2008 9:16 pm    Post subject:
Reply with quote

Hi Som,

What is the ACCESS and ORGANIZATION used in your SELECT stmt?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1