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

Getting VSAM error code 37


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Tue May 13, 2014 4:42 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue May 13, 2014 4:50 pm
Reply with quote

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
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Tue May 13, 2014 5:09 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue May 13, 2014 5:13 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 13, 2014 5:32 pm
Reply with quote

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
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Tue May 13, 2014 5:48 pm
Reply with quote

Thanks Bill and Robert,
I tried with DISP=old and i am getting the same error.
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Tue May 13, 2014 5:52 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 13, 2014 8:43 pm
Reply with quote

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
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Wed May 14, 2014 9:30 am
Reply with quote

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
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Wed May 14, 2014 12:32 pm
Reply with quote

Bearing in mind the DFDSS manual is 700 pages, I'm not sure what "complete syntax" you expect anyone to post?
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 81
Location: India

PostPosted: Wed May 14, 2014 1:34 pm
Reply with quote

Thanks everyone for you Reply.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed May 14, 2014 8:45 pm
Reply with quote

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
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top