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

How do we define a composite key in ims db


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anirudh1985
Currently Banned

New User


Joined: 22 Aug 2007
Posts: 66
Location: bangalore

PostPosted: Wed Apr 16, 2008 1:12 pm
Reply with quote

How do we define a composite key in ims db?
Back to top
View user's profile Send private message
anirudh1985
Currently Banned

New User


Joined: 22 Aug 2007
Posts: 66
Location: bangalore

PostPosted: Wed Apr 16, 2008 3:22 pm
Reply with quote

can somebody pleas help me with this
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Apr 16, 2008 4:33 pm
Reply with quote

I, for one, have no idea what a "composite key" is having never heard that term. If you could define what you want, maybe someone can help.
Back to top
View user's profile Send private message
anirudh1985
Currently Banned

New User


Joined: 22 Aug 2007
Posts: 66
Location: bangalore

PostPosted: Wed Apr 16, 2008 4:45 pm
Reply with quote

Sandy Zimmer wrote:
I, for one, have no idea what a "composite key" is having never heard that term. If you could define what you want, maybe someone can help.

the followins is the part of our DBD:
WHNO and PARTNO are supposed to be combined keys. Is the definition justified?

DBD NAME=YJEPU, *
ACCESS=(HDAM,OSAM),RMNAME=(DFSHDC40,1,150)
DATASET DD1=YJEPU1, *
DEVICE=3390,SIZE=4096

***************************************************************
SEGM NAME=EPROOT, *
BYTES=178, *
PARENT=0
FIELD NAME=(KEY,SEQ,U), *
BYTES=23, *
START=1
FIELD NAME=WHNO, *
BYTES=2, *
START=1
FIELD NAME=PARTNO, *
BYTES=21, *
START=3
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Apr 16, 2008 4:55 pm
Reply with quote

BYTES=23, *
START=1
FIELD NAME=WHNO, *
BYTES=2, *
START=1
FIELD NAME=PARTNO, *
BYTES=21, *
START=3

For the physical database definition your key is 23 bytes. Why have you tried to separate it. In IMS your key is defined left to right. What is WHNO?
Back to top
View user's profile Send private message
anirudh1985
Currently Banned

New User


Joined: 22 Aug 2007
Posts: 66
Location: bangalore

PostPosted: Wed Apr 16, 2008 6:35 pm
Reply with quote

Sandy Zimmer wrote:
BYTES=23, *
START=1
FIELD NAME=WHNO, *
BYTES=2, *
START=1
FIELD NAME=PARTNO, *
BYTES=21, *
START=3

For the physical database definition your key is 23 bytes. Why have you tried to separate it. In IMS your key is defined left to right. What is WHNO?


This key contains both WHNO and PARTNO as a composite key.We need both of the to be keys..is dis definition apt?
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Apr 16, 2008 6:43 pm
Reply with quote

You will not be able to lookup PARTNO as a separate key. You could do a boolean SSA with the high order WHNO provided.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Apr 17, 2008 1:53 am
Reply with quote

I'm afraid TS is trying to convert DB2 to IMS and still wants to keep the composite key alive. I never defined a DB like TS did. Wonder what happens when TS generates it and tries to access it i.e using DLITEST. Anyway, the 23 bytes defined as (KEY,SEQ,U) are the unique sequence field stored in the index and might be retrieved quickly using a GU. The fields overlaying the KEY will not be indexed. Curious to follow what happens after DBDGEN and test.
Back to top
View user's profile Send private message
anirudh1985
Currently Banned

New User


Joined: 22 Aug 2007
Posts: 66
Location: bangalore

PostPosted: Thu Apr 17, 2008 11:12 am
Reply with quote

Ok so how wud we define whno and partno together as keys...And the database access method is OSAM..and we are supposed to load it during which we are getting XC status code.How will we correct this?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Apr 17, 2008 2:27 pm
Reply with quote

As for the XC status code I noticed you have a separate item openend.

As for your key problem please first explain your business case. How are you supposed to retrieve the segments; in other words, what is your access path.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Apr 17, 2008 4:25 pm
Reply with quote

Your access method is HDAM. So, you can retrieve keys online more quickly. However, it does not have a separate index such as HIDAM. Think very carefully about how you will be using this database.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Thu Apr 17, 2008 4:35 pm
Reply with quote

George - I think that WHNO is warehouse number. I think what they are trying to do is have partno within warehouse. If that is the case, they perhaps should have warehouse as a root segment - part number as the child.
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 -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts Define default volume for DSN storage... JCL & VSAM 8
No new posts define 1 DCB parms for multiple outpu... JCL & VSAM 9
This topic is locked: you cannot edit posts or make replies. REXX to find /* Define and write the ... CLIST & REXX 5
No new posts How to define transaction that trigge... CICS 3
Search our Forums:

Back to Top