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

about multiple occurrences (twins)


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

Active User


Joined: 06 Apr 2005
Posts: 180

PostPosted: Thu Jul 07, 2005 3:18 am
Reply with quote

1)What does the statement "multiple occurrences of a particular child segment " mean with respect to wins.

2)What is the need to have the multiple occurrences.Do all the occurrences contain the same information.or do thay represent the different fields of a segment .

3)How do we access an nth occurrence of a segment.
We have functions to acess the first and the last occurrences but say there are 5 occurrences and we want to access the 2,3,4 one.How do we do that?

Please corect me if I am wrong abou any concept here.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Jul 07, 2005 3:30 pm
Reply with quote

Hi vijayamadhuri,

Quote:
1)What does the statement "multiple occurrences of a particular child segment " mean with respect to wins.

Multiple occurrences of a child segment means there are more than one value of child for a perticular parent.

Quote:
2)What is the need to have the multiple occurrences.

Assume a case where you have to make a database of student for different subjects. Student info will be in parent segment and courses covered should be in child segment. where a student having more than one course would be having more than one child segment.

Quote:
Do all the occurrences contain the same information.or do thay represent the different fields of a segment .

All the occurrences contain different info of same type.

Quote:
3)How do we access an nth occurrence of a segment.

Suppose u r giving a GNP call to child then u can put a counter in GNP call if CALL RETURN CODE is SPACES. then by comparing the counter u can access perticular occirrences.

Regards,

Priyesh.
Back to top
View user's profile Send private message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Fri Jul 08, 2005 11:33 am
Reply with quote

Hi,

Quote:
counter in GNP


May I know how?




Regards,
Sudhaaa.
Back to top
View user's profile Send private message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Fri Jul 08, 2005 11:52 am
Reply with quote

Hi Madhu,

Hope you need to study once again the basic concepts.

Suppose consider one simple example as in book.

1st level - VENDOR
2nd level - ITEM
3rd level - LOCATION

In VENDOR segment you have diff fields describing VENDOR personnel details like his CODE, NAME etc.. similarly ITEM and LOC.
One VENDOR can sold diff ITEMs in diff LOCs. So, now if you wanna crate a HDBMS, you have to create a DBD with one ROOT segment and CHILD segments. In PCB you specify PARENT=....... for each SEGM field other than for ROOT segment.

Now for your question




Quote:
1)What does the statement "multiple occurrences of a particular child segment " mean with respect to wins.


One ITEM can sold in diff LOCATIONs. So, multiple occurences for LOCATION.
I hope you know about TWINs, two or more of segment occurences of same type, having same parent are TWINS. In the example you can say LOCATIONs are TWINs and as well as multiple occurrences of a particular child segment. Just think if ITEM has one more child segment at 3rd level namely PRICE. Then you can say all LOC occurences are TWINs, but multiple occurrences of a particular child segment are both LOCs and PRICEs.

A bit confusing, I think. Sorry,if it is so.

Quote:
Do all the occurrences contain the same information.or do thay represent the different fields of a segment .


Then why we need of diff SEGMENT occurences.

Quote:
3)How do we access an nth occurrence of a segment.


Priyesh, can you explain me how to set counter for GNP call. My thought was( may be its a turnaround method) use GU call to set position at that level, issue successive GN calls.

I also expecting effecient way than me.

Regards,
Sudhaaa.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Jul 08, 2005 2:59 pm
Reply with quote

Hi Sudhaaa,

Quote:
Priyesh, can you explain me how to set counter for GNP call.


What I meant to say was...to give a GNP Call & if RETURN CODE = SPACES ..means first occurrences of child got found.......So there u can add 1 to any counter (initialized to zero earlier)......

And again perform the GNP Para for the same parent, again if RET CODE is SPACES....means u got next occurrence of child.....Here again the value of counter will be increamented......this process will continue till u get END OF DB....that is RET CODE "GE" or "GB".........

I hope I was clear.....If you have any doubt ...get back.....

Regards,

Priyesh.
Back to top
View user's profile Send private message
sudhaaa

New User


Joined: 24 Mar 2005
Posts: 51

PostPosted: Sun Jul 10, 2005 5:14 pm
Reply with quote

THANKS icon_biggrin.gif
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
Search our Forums:

Back to Top