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
 

 

Reading 2 segments down

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

Active User


Joined: 03 Dec 2005
Posts: 120
Location: india

PostPosted: Thu May 07, 2009 3:46 pm    Post subject: Reading 2 segments down
Reply with quote

I have a database structure like this..

A
|
v
B
|
v
C

I need to sequentially read this database:
I wrote the following calls...

GN on segment A until END OF SEGMENT A
GNP on B unitl END OF SEGMENT B
GNP on C until END of SEGMENT C

Problem faced:

First time it reads fine. i.e first occurence of B under A is read fine. All occurences of C is also read fine.
But when, END of C is reached and again contol returns to do a GNP on B, it gives GE and does not return the next occurence of B under A.

Can anyone help me with this loop!
Back to top
View user's profile Send private message

Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu May 07, 2009 9:07 pm    Post subject:
Reply with quote

You could just do a GN on A, B & C and get all 3 at the same time.
This would be done with 1 loop instead of 3 nested loops (I think that is what you meant to show). This would be more efficient.

Or you could use 3 different PCBs
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Fri May 08, 2009 12:47 am    Post subject: What kind of SSA did you use?
Reply with quote

It looks like you used QSSA. If you specified QSSA on "B" level, then GNP with QSSA is acting like that.
Back to top
View user's profile Send private message
Srileka

New User


Joined: 21 Jun 2007
Posts: 19
Location: India

PostPosted: Mon May 11, 2009 3:43 pm    Post subject: Reply to: Reading 2 segments down
Reply with quote

Hi,
Basically a GNP call should always be preceeded by a GN or GU call because a GNP cannot establish the parentage.
Your GN call will set the parentage at A. So GNP for B will fetch all ocurences of B with A as parent. And this GNP will not set the parentage to B for issuing GNP for C. The parent is still A. So you will get all the occurences of C with A as parent. It cannot limit the fetch of C with parent as each occurence of B. That is why at the end of C you get GE instead of fetching the next occurence of B.

Now let us see how to get the expected result.
Procedure 1:
1) GN call for A
2) GNP call for B
3) GNP call for C with 2 SSAs as below
segmentB *U
segmentC

* at position 9

The command code U will set the parentage at B. So the GNP call for C will limit the search for C with parent as that particular occurence of B.
But using command codes is not advisable always if you consider performance.
In that case follow this.
Procedure 2:
1) GN call for A
2) GNP call for B
3) GN call for C with qualified SSA's for A and B and unqualified SSA for C i.e get the key from A and B and qualify those segments and then call segment C.

Please let me know if you need more info.

Thanks,
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 Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts Reading selected volumes of a multi-v... RickBig JCL & VSAM 6 Wed Jul 13, 2016 7:26 pm
No new posts How to define PCB for paired segments ashok_uddaraju IMS DB/DC 4 Tue Jun 14, 2016 11:40 pm


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