Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Getting VSAM error code 37

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 69
Location: India

PostPosted: Tue May 13, 2014 4:42 pm    Post subject: Getting VSAM error code 37
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue May 13, 2014 4:50 pm    Post subject: Reply to: Getting VSAM error code 37
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 - http://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: 69
Location: India

PostPosted: Tue May 13, 2014 5:09 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue May 13, 2014 5:13 pm    Post subject: Reply to: Getting VSAM error code 37
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: 7913
Location: Bellevue, IA

PostPosted: Tue May 13, 2014 5:32 pm    Post subject:
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: 69
Location: India

PostPosted: Tue May 13, 2014 5:48 pm    Post subject:
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: 69
Location: India

PostPosted: Tue May 13, 2014 5:52 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue May 13, 2014 8:43 pm    Post subject:
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: 69
Location: India

PostPosted: Wed May 14, 2014 9:30 am    Post subject:
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: 175
Location: UK

PostPosted: Wed May 14, 2014 12:32 pm    Post subject:
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: 69
Location: India

PostPosted: Wed May 14, 2014 1:34 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Wed May 14, 2014 8:45 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us