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

Error opening KSDS - code 37


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mahendrakariya

New User


Joined: 21 Jun 2011
Posts: 7
Location: India

PostPosted: Thu Jul 21, 2011 11:34 am
Reply with quote

Hi,

I am trying to open a KSDS in COBOL. I am getting error code 37.

JCL the created KSDS is as follows. Please ignore the number of X's in the DSN names. I assure they are correct in the actual JCL.

Code:

//XXXXXXR JOB (ACCT#,&SYSUID),,
// MSGCLASS=A,CLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*** STEP1 DELETES PREVIOUSLY DEFINED CLUSTER ****
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD * 00030200
DELETE XXXXXX.XXXX.TXN.V CLUSTER
/*
//*** STEP2 CREATES FRESH CLUSTER ****
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER -
(NAME(XXXXXX.XXXX.TXN.V) -
TRACKS(10 5) -
CISZ(4096) -
FREESPACE(10 20)-
KEYS(7 0) -
RECORDSIZE(36 36)) -
DATA (NAME(XXXXXX.XXXX.TXN.V.D)) -
INDEX (NAME(XXXXXX.XXXX.TXN.V.I))
/*
//*** STEP3 REPROES CLUSTER FROM XXXXXX.XXXX.DUMMY
//*** XXXXXX.XXXX.DUMMY TO HAVE A SINGLE RECORD WHICH IS ALL ZEROS
//*** THIS IS NEEDED TO AVOID PROBLEMS OPENING AN EMPTY VSAM FILE
//STEP3 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INPUT DD DSN=XXXXXX.XXXX.DUMMY,DISP=SHR
//OUTPUT DD DSN=XXXXXX.XXXX.TXN.V,DISP=OLD
//SYSIN DD *
REPRO -
INFILE (INPUT) -
OUTFILE (OUTPUT) -
REPLACE
/*
//*** STEP4 CREATES FRESH CLUSTER FOR THE ALTERNATE INDEX ***
//STEP4 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE AIX(NAME(XXXXXX.XXXX.TXN.V.ALT) -
RELATE(XXXXXX.XXXX.TXN.V) -
TRACKS(10 5) -
CISZ(4096) -
FREESPACE(10 20) -
KEYS(5 7) -
NONUNIQUEKEY -
UPGRADE -
RECORDSIZE(80 80)) -
DATA (NAME(XXXXXX.LOAN.TXN.V.ALT.D)) -
INDEX (NAME(XXXXXX.LOAN.TXN.V.ALT.I))
/*
//*STEP5 BUILDS THE INDEX
//STEP5 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
BLDINDEX -
INDATASET(XXXXXX.LOAN.TXN.V) -
OUTDATASET(XXXXXX.LOAN.TXN.V.ALT) -
INTERNALSORT
/*
//*STEP6 CREATES THE PATH
//STEP6 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE PATH (NAME(XXXXXX.LOAN.TXN.V.PATH) -
PATHENTRY (XXXXXX.LOAN.TXN.V.ALT) -
UPDATE)
/*
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 21, 2011 11:38 am
Reply with quote

Is that in step99 ?
Back to top
View user's profile Send private message
mahendrakariya

New User


Joined: 21 Jun 2011
Posts: 7
Location: India

PostPosted: Thu Jul 21, 2011 11:41 am
Reply with quote

step 99...?

This JCL is running with MAXCC=0.

When I do

Code:

OPEN OUTPUT KSDSFILE


in cobol, I am getting error code 37.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 21, 2011 11:45 am
Reply with quote

Please use REUSE parameter in the Define cluster
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 21, 2011 11:46 am
Reply with quote

Read dbzTHEdinosauer's link in your previous KSDS error post.
And next time dont give us this jcl/idcams crap if it concerns
a cobol error.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 21, 2011 11:52 am
Reply with quote

gylbharat wrote:
Please use REUSE parameter in the Define cluster


A VSAM data set must be marked nonreusable before you can build an alternate index over it. This VSAM requirement applies whether or not DFM is used to build the index
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 21, 2011 11:58 am
Reply with quote

Thanks Peter for the information...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 21, 2011 7:33 pm
Reply with quote

Hello,

Quote:
And next time dont give us this jcl/idcams crap if it concerns
a cobol error.
Helpful when the cobol error is caused by the definition. . . At least for me icon_smile.gif

Quote:
A VSAM data set must be marked nonreusable before you can build an alternate index over it. This VSAM requirement applies whether or not DFM is used to build the index
Does anyone know when this became "the rule"?

Some people of my acquaintance got bitten big time a couple of weeks ago when all of the Production jobs that have vsam with an alternate index did not follow this rule. These processes had been running for many years. Something worthy of note is that they upgraded from z/OS 1.7 to 1.9 to 1.11 in less than 2 years (wanted to use new hardware and software features that would not run on the older z/OS, or so i'm told).

When they called, i recalled the "rule" but not when it went "fail" rather than some kind of "warn". This happened to them literally overnight (happened to be a weekend when lots of vsam is mucked with) and many many jobs came crashing down.

Thanks for any input icon_smile.gif

d
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 21, 2011 7:37 pm
Reply with quote

That's is typical IBM.

a warning should be translated as: tomorrow this may fall over.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 21, 2011 7:43 pm
Reply with quote

looks like their problem determination was a bit inaccurate, at least icon_cool.gif

from the zos 1.7 manual
z/OS V1R7.0 DFSMS Access Method Services for Catalogs
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt2i240/EDITION?SHELF=DGT2BK51.bks&DT=20050629061743


Quote:
REUSE|NOREUSE
Specifies whether or not the cluster can be opened again and again as a reusable cluster.
If REUSE or NOREUSE is specified in the SMS data class, the value defined is used as the data set definition, unless it has been previously defined with an explicitly specified or modeled DEFINE attribute.

REUSE
Specifies that the cluster can be opened again and again as a reusable cluster. When a reusable cluster is opened, its high-used RBA is set to zero if you open it with an access control block that specifies the RESET attribute.
REUSE lets you create an entry-sequenced, key-sequenced, or relative record work file.

When you create a reusable cluster, you cannot build an alternate index to support it. Also, you cannot create a reusable cluster with key ranges (see the KEYRANGE parameter). Reusable data sets can be multivolume and can have up to 123 physical extents.

Restriction: If you select REUSE and your command also contains the keyword UNIQUE, you must remove the UNIQUE keyword or the DEFINE command will be unsuccessful.

Abbreviation: RUS

NOREUSE
Indicates that the cluster cannot be opened again as a new cluster.
Abbreviation: NRUS





and from the same for os/390 2.10
OS/390 V2R10.0 DFSMS Access Method Services for Catalogs
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT1I211/CCONTENTS?SHELF=DGT1BK33&DN=SC26-7326-01&DT=20001016161533

Quote:
REUSE|NOREUSE
specifies whether the cluster can be opened again and again as a reusable cluster.

If REUSE or NOREUSE is specified in the SMS data class, the value defined is used as the data set definition, unless it has been previously defined with an explicitly specified or modeled DEFINE attribute.

REUSE
specifies that the cluster can be opened again and again as a reusable cluster. When a reusable cluster is opened, its high-used RBA is set to zero if you open it with an access control block that specifies the RESET attribute.

REUSE lets you create an entry-sequenced, key-sequenced, or relative record work file.

When you create a reusable cluster, you cannot build an alternate index to support it. Also, you cannot create a reusable cluster with key ranges (see the KEYRANGE parameter). Reusable data sets can be multivolume and can have up to 123 physical extents.

Note: If you select REUSE and your command also contains the keyword UNIQUE, you must remove the UNIQUE keyword or the DEFINE command will be unsuccessful.

Abbreviation: RUS

NOREUSE
indicates that the cluster cannot be opened again as a new cluster.

Abbreviation: NRUS


in a while i' ll fire up an MVS 3.8 and will try to check if the restriction was there from the seventies icon_biggrin.gif
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: Thu Jul 21, 2011 7:56 pm
Reply with quote

Quote:
I am trying to open a KSDS in COBOL. I am getting error code 37.
With this problem statement, we need to see three things:
1. the SELECT statement in the COBOL program
2. the JCL you are executing the COBOL program with -- and in particular, the DD names for the VSAM file
3. the OPEN statement in the COBOL program.

While other things like the file defintion JCL are fine, they're not going to help resolve your issue. And if you are not using the extended file status codes for a VSAM file, you should add them to your code since the function and feedback codes can be vey helpful in resolving problems.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 21, 2011 9:07 pm
Reply with quote

Hi Enrico,

Quote:
looks like their problem determination was a bit inaccurate, at least
Well, maybe. All i have is their assurance that these more than 100 jobs that run on the weekend have all run successfully "forever" and then thud - all the same weekend.

In the past when something was going to "die", i've seen messages that tell the date the failure will happen, but they swear they had no such messages.

So far i've not found any material that explains a "warn" mode.

d
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 21, 2011 9:17 pm
Reply with quote

dick scherrer wrote:
Hello,

Quote:
And next time dont give us this jcl/idcams crap if it concerns
a cobol error.
Helpful when the cobol error is caused by the definition. . . At least for me icon_smile.gif



Dick, a listcat should have been enough. I just wanted to say that if you have a cobol error, give the cobol source, jes output and a listcat.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 21, 2011 9:24 pm
Reply with quote

Hi Peter,

Quote:
I just wanted to say that if you have a cobol error, give the cobol source, jes output and a listcat.
Yup, i agree for the first time thru icon_smile.gif

d
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 -> JCL & VSAM

 


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 CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top