Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message

Active User

Joined: 06 Apr 2005
Posts: 180

 Posted: Thu Jul 07, 2005 3:18 am    Post subject: about multiple occurrences (twins) 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.

priyesh.agrawal

Senior Member

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

Posted: Thu Jul 07, 2005 3:30 pm    Post subject: Re: about multiple occurrences (twins)

 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.
sudhaaa

New User

Joined: 24 Mar 2005
Posts: 51

Posted: Fri Jul 08, 2005 11:33 am    Post subject:

Hi,

 Quote: counter in GNP

May I know how?

Regards,
Sudhaaa.
sudhaaa

New User

Joined: 24 Mar 2005
Posts: 51

Posted: Fri Jul 08, 2005 11:52 am    Post subject: Re:

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.

 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.
priyesh.agrawal

Senior Member

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

Posted: Fri Jul 08, 2005 2:59 pm    Post subject: Re: about multiple occurrences (twins)

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.
sudhaaa

New User

Joined: 24 Mar 2005
Posts: 51

 Posted: Sun Jul 10, 2005 5:14 pm    Post subject: Re THANKS
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us