View previous topic :: View next topic
|
Author |
Message |
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
Hi,
I am opening VSAM KSDS file in Output mode and in JCL, it is defined as DISP=MOD
The program has not been changed and also the JOB has not been changed.
The job is running fine in production.
For testing, i took the same prod version program and JCL and copied to VSAM Production file to Test file but the program is throwing error-
Code: |
OPEN OUTPUT ERROR ON COST CHG FILE
VSAM STATUS = 37
|
I know that this error might occur due to the below-
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.
I even deleted the copied file and again copied it from production using REPRO but still the same error.
Could anyone please help me. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Status code 37, from the manual -
Quote: |
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.
|
Sticky - ibmmainframes.com/viewtopic.php?t=32811 |
|
Back to top |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
Thanks Bill,
I am aware of the above Reason but i am not sure why the error is coming as i have neither done any change in job nor in Program. It is running perfectly alright in production.
I just copied the data from Prod to Test and ran it. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Use the extended FILE STATUS which is available for VSAM files. See the Language Reference and the Programming Guide.
Show the code, including SELECT and FD with definitions and the OPEN itself, and the code producing that message. LISTCAT of the file.
DISP=MOD on a VSAM file? I've never done that :-) |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
From the JCL Reference manual (emphasis added by me):
Quote: |
MOD
Indicates one of the following:
The data set exists and records are to be added to the end of it. The data set must be sequential.
A new data set is to be created.
In either case, MOD specifies exclusive (unshared) use of the data set. When the data set is opened, the read/write mechanism is positioned after the last sequential record for an existing data set or at the beginning for a new data set. For subsequent OPENs within the same step, the read/write mechanism is positioned after the last sequential record. |
Change DISP=MOD to DISP=SHR (or OLD). If you insist on using DISP=MOD, then make sure your program has ACCESS SEQUENTIAL specified for the VSAM KSDS -- RANDOM or DYNAMIC flat out will not work with DISP=MOD (and I'm not 100% sure ACCESS SEQUENTIAL would allow DISP=MOD on a VSAM KSDS, either -- it may be that DISP=MOD is just not allowed for a KSDS). |
|
Back to top |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
Thanks Bill and Robert,
I tried with DISP=old and i am getting the same error. |
|
Back to top |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
Hi Bill and Robert,
I got the issue. The problem was while defining the VSAM file using IDCAMS, i was using the REUSE=No, i deleted the file again and this time created with REUSE=YES and i did not get the VSAM status 37 |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
In other words, despite what you posted you did NOT copy the file from production to test -- you re-created it, and you re-created it wrong. Next time, use DFDSS (ADRDSSU) to actually copy the file and you shouldn't run into this issue. |
|
Back to top |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
Robert,
Can you please tell me for what purpose DFDSS (ADRDSSU) is actually used and what is it complete syntax.
there is also a utility with this name but i never used it. Can we use this utility for copying VSAM files? |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Bearing in mind the DFDSS manual is 700 pages, I'm not sure what "complete syntax" you expect anyone to post? |
|
Back to top |
|
|
sandeep kumar302
New User
Joined: 14 Mar 2012 Posts: 81 Location: India
|
|
|
|
Thanks everyone for you Reply. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
ADRDSSU s IBM's copy / dump program (at least, one of them). It can be used to dump production VSAM files to tape, for example, and then restore them using the test high-level qualifier. The actual syntax depends somewhat on your site, so you would need to consult with your site support group for the details. |
|
Back to top |
|
|
|