View previous topic :: View next topic
|
Author |
Message |
anirudh1985 Currently Banned New User
Joined: 22 Aug 2007 Posts: 66 Location: bangalore
|
|
|
|
How do we define a composite key in ims db? |
|
Back to top |
|
|
anirudh1985 Currently Banned New User
Joined: 22 Aug 2007 Posts: 66 Location: bangalore
|
|
|
|
can somebody pleas help me with this |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
anirudh1985 Currently Banned New User
Joined: 22 Aug 2007 Posts: 66 Location: bangalore
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
anirudh1985 Currently Banned New User
Joined: 22 Aug 2007 Posts: 66 Location: bangalore
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
|
anirudh1985 Currently Banned New User
Joined: 22 Aug 2007 Posts: 66 Location: bangalore
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
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 |
|
|
|