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
 
What is the difference between GU, GN and GNP?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
View previous topic :: :: View next topic  
Author Message
roy_robi

New User


Joined: 25 Dec 2006
Posts: 4
Location: chicago

PostPosted: Wed Dec 27, 2006 1:40 am    Post subject: What is the difference between GU, GN and GNP?
Reply with quote

What is the difference between GU, GN and GNP? Can someone explain it with an example?
In a database if I use GU I will get only one segment.
If I want every segment then I use GN and process each segment.

But what about GNP? ( instead of using this I can use GN but qualified it upto it's parent)

I would appreciate if you give an example.

Thx,
Robi

Title changed from "CALL Functions" to "What is the difference between GU, GN and GNP?" : Priyesh.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


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

PostPosted: Wed Dec 27, 2006 2:04 am    Post subject: Re: What is the difference between GU, GN and GNP?
Reply with quote

Robi... Pls go thru FORUM Rules on to make a good posting...
Quote:
What is the difference between GU, GN and GNP? Can someone explain it with an example?

let's have an example...

Root => Student
1st Child => Course
2nd Child => Exams

If you want to find out information for student "Robi" you would give a GU call at root segment with KYVAL passed as "Robi".

If you want to get information for all the students from the root segment, you would issue a GN call at root segment with passed nothing; UNTIL EoS (end of segment).

If you want to get all the course details for all the students.
1> GN Call (as per above) until EoS.
2> within each GN Call, GNP on Course segment until EoS.

Quote:
In a database if I use GU I will get only one segment.

In a segment if I issue GU, I'll get only one occurrence.
Quote:
If I want every segment then I use GN and process each segment.

Read it as "occurrence" instead of "segment".
Quote:
But what about GNP? ( instead of using this I can use GN but qualified it upto it's parent)

Could you make it more clear...
Back to top
View user's profile Send private message
roy_robi

New User


Joined: 25 Dec 2006
Posts: 4
Location: chicago

PostPosted: Wed Dec 27, 2006 2:21 am    Post subject: Re: What is the difference between GU, GN and GNP?
Reply with quote

Thanks Priyesh. This was my first posting.

I see your example. Now could you please explain when and how I should use GNP call.
I have seen GNP call but do not understand the difference between GN and GNP call. If you want to access Get Next Parent (GNP) then why not use GN in the parent level?

Thanks in advance.

Robi
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1191
Location: Bangalore,India

PostPosted: Wed Dec 27, 2006 9:55 am    Post subject:
Reply with quote

Hi Robi,


GNP : Get next in the parent..

A GNP call retrieves segments sequentially. The difference between a GN and a GNP is that GNP limits the segments that can satisfy the call to the dependent segments of the established parent.
An unqualified GNP retrieves the first dependent segment occurrence under the current parent. If your current
position is already on a dependent of the current parent, an unqualified GNP retrieves the next segment occurrence.

If you are moving forward in the database, even if you are not retrieving every segment in the database, you can use GNP to restrict the returned segments to only those children of a specific segment.

lets take an example...
I have a database where PDTLSEG(policy detail segment) is the root segment PTRANSEG & POCCDSEG is child of PDTLSEG & PANALSEG is child of PTRANSEG .
Now if i want to retrieve all the PANALSEG that belongs to particular policy & TRansaction then i have to set parentage by issuing a qualified GU call
for that PTRANSEG under that PDTLSEG.Then if i issue GNP until End of database i will able to get all PANALSEG But if i issue GN then i will get POCCDSEG also which i dont require.

Hope it will helpful
Back to top
View user's profile Send private message
sreekarreddyg

New User


Joined: 22 Apr 2006
Posts: 2

PostPosted: Sat Jan 20, 2007 7:17 pm    Post subject:
Reply with quote

Hi Robi,

The definition for GNP is Get Next within the Parent and not Get Next parent as written by u in the above.
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: Mon Jan 22, 2007 2:53 pm    Post subject:
Reply with quote

It's a while ago TS wrote to us but if he/she ever gets back to this topic I suggest some reading over here.
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
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm

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