|
|
| Author |
Message |
som_infotech
New User
Joined: 25 Feb 2006 Posts: 22 Location: chennai-india
|
|
|
|
| when i am trying to open a vsam file in write mode its giving me File staus code 37. |
|
| Back to top |
|
 |
References
|
Posted: Wed Aug 16, 2006 12:01 pm Post subject: Re: VSAM FILE STATUS 37 when open a vsam file in write mode |
 |
|
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3008 Location: Charlotte,NC USA
|
|
|
|
"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 |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3008 Location: Charlotte,NC USA
|
|
|
|
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 |
|
 |
pattabiraman.baskaran
New User
Joined: 10 Aug 2006 Posts: 24
|
|
|
|
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.  |
|
| Back to top |
|
 |
silentarya
New User
Joined: 11 Mar 2007 Posts: 12 Location: Chennai
|
|
|
|
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 |
|
 |
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1473
|
|
|
|
Hi Som,
What is the ACCESS and ORGANIZATION used in your SELECT stmt? |
|
| Back to top |
|
 |
|
|