Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Question on GNP Call

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

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Sat Feb 21, 2009 5:06 pm    Post subject: Question on GNP Call
Reply with quote

Hi,
I have a database with the below structure.
Root
|
Policy
|
Overflow

I tried to read all the overflow segment occurences for each policy segment occurence. For this i had GNP call (unqualified SSA) to policy segment withing a loop. For each successful retrieval of policy segment I had a loop to call all its overflow segments. Here i used GNP (unqualified SSA).

Problem is, I had only one overflow occurence, but the loop for overflow segment gave successful retrieval twice. When checked the PCBMASK, first iteration seems to move from level 02 to 03 (got the first occurence of overflow), in the second iteration segment levels before and after call is 03 and i got the same data again.

I expected that the second iteration would not fetch me the same record again and it should have given me a GE.

Note:
The GNP call in the loop for policy segment is retrieving properly. Its not repeating the fetch.

Srileka.V
Back to top
View user's profile Send private message

Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Sat Feb 21, 2009 6:09 pm    Post subject:
Reply with quote

Please post your code. And, why are you using GNP instead of qualifying your SSA down?
Back to top
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Mon Feb 23, 2009 12:35 pm    Post subject:
Reply with quote

Hi,
The code worked after having U command code in XPOLSEG when calling the overflow segment.

XPOLSEG --> Policy segment name
XPOLOV1 --> Overflow segment name

DCL SSAOVPN CHAR(40) INIT('XPOLSEG *U');
DCL SSAOV1N CHAR(40) INIT('XPOLOV1');

CALL PLITDLI(FIVE,GNP,PCB,IOAREA2,SSAOVPN,SSAOV1N);

Coming to your question,
Do you want me to capture the key in the policy segment and use that when calling the overflow segment?
Like,

DCL SSAOVPN CHAR(40) INIT('XPOLSEG (XPOLYEAR=2008)');
DCL SSAOV1N CHAR(40) INIT('XPOLOV1');

CALL PLITDLI(FIVE,GNP,PCB,IOAREA2,SSAOVPN,SSAOV1N);

Sorry if my understanding is wrong.

Please clarify my below doubt,
1) In my case, I issued GNP calls in loop for segments at level 02, and for each successful retrieval of level 02 segment I issued GNP calls in loop for level 03 segments. Will the first GNP call set parentage for the second GNP call? Should GNP calls always issued after GN or GU calls only? Cant it preceed with a GNP call?
I believe command code U does the job of setting parentage when we want to issue GNP calls (for level 03) after a GNP(for level 02). Please let me know if my understanding here is wrong.

Thanks & Regards,
Srileka.V
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 23, 2009 6:04 pm    Post subject:
Reply with quote

If you have keyed parent segments there is no need for GNP and the use of command codes. You simply qualify the SSA statements above the segment you want and loop your child segment with an unqualified SSA.

Are you first reading all roots? Then are you reading all level 2 segments going after level 3 segments?
Back to top
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Mon Feb 23, 2009 6:20 pm    Post subject:
Reply with quote

Yes. I am reading all the root segments in loop, at each successful retrieval of root am reading all its policy segments in loop and at each successful retrieval of policy segment am readng all its overflow segments in loop.
Is there any difference in performance when we use command codes and qualifying the SSA at higher levels? Basically i want to know why you prefer the second option than going with command codes. Our production code also doesnt use much of command codes. Instead they have followed whatever you stated above.

Thanks,
Srileka.V
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Mon Feb 23, 2009 6:34 pm    Post subject:
Reply with quote

When I first learned IMS, I too used command codes. Then I learned that the best way is always the most easily maintainable way - the most straightford approach. Try to stay away from command codes if you can. Also, it always helps to know what is the business purpose - there may be an easier way - and more efficient - to accomplish a request.

I know that I have the parent-child loop logic posted here somewhere. Here it is - in simple pseudo....

root - loop with unqualified SSA until GB - if not GB (spaces) - qualify your root SSA with the key from this root and do loop 2

loop 2 - use qualified root SSA and unqualified level 2 SSA and loop until GB or GE - if spaces - qualify level 2 SSA and do loop 3

loop 3 - use qualified root SSA and qualified level 2 SSA and unqualified level 3 SSA and loop until GB or GE

So, you will be reading all root segments - all level 2 segments under this root - and all level 3 segments under each root and level 2.
Back to top
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Mon Feb 23, 2009 6:54 pm    Post subject:
Reply with quote

Sandy,
Thank you so much for the valuable info.

Regards,
Srileka.V
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 QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Need help in triggering a PL1 module ... Varungv99 IMS DB/DC 0 Fri Apr 07, 2017 10:01 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us