Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How do we define a composite key in ims db

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: How do we define a composite key in ims db
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Apr 17, 2008 1:53 am    Post subject:
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Apr 17, 2008 2:27 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am
No new posts How to define PCB for paired segments ashok_uddaraju IMS DB/DC 4 Tue Jun 14, 2016 11:40 pm
No new posts Define Alias for multiple Data sets u... sandy98669 JCL & VSAM 4 Fri May 27, 2016 1:07 pm
No new posts trying to define a VSAM Cluster in JCL t5590ag JCL & VSAM 10 Thu May 19, 2016 5:52 am
No new posts Need Help to Define 36 Input Fields (... satish.ms10 CLIST & REXX 2 Sat May 07, 2016 3:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us