MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use of 2 Pointers in IMS

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
manojagrawal
Beginner


Joined: 25 Feb 2003
Posts: 124
Topics: 29

PostPosted: Tue Mar 25, 2003 7:38 am    Post subject: Use of 2 Pointers in IMS Reply with quote

Hi,

Quite a few posts coming up on IMS from me. Well can anyone tell me a good book on IMS Programming using PL/I???

Now, can we have 2 pointers pointing to the same IMS DB. What I want is a pointer which would read rows with a certain condition and another pointer which would read rows with an additional condition to the first, so that it is a subset.

How do we do this?

Regards
Manoj.
Back to top
View user's profile Send private message
manojagrawal
Beginner


Joined: 25 Feb 2003
Posts: 124
Topics: 29

PostPosted: Wed Mar 26, 2003 11:21 am    Post subject: Reply with quote

Hi,

Well this is what I want to do. And this is the reason why I thought 2 pointers would work. Would anyone have a suggestion as to any way to solve this?

The IMS DB i have contains records like this:

    AAAA ___ ____ Call this Master Record
    AAAA 123 XXXX Call these sub records.
    AAAA 323 XXXX
    AAAA 456 YYYY
    AAAA 345 XXXX
    AAAA 989 YYYY

    BBBB ___ ____ Another Master Record.
    BBBB 123 YYYY Another Sub Record.
    BBBB 323 XXXX
    BBBB 456 YYYY

    and so on......

Now what I want to do is this. I want to fill the third column of each Master Record using the Pre-dominant value of the Sub Records.

What i was thinking is to use 2 pointers. One which would read all master records and another which would read each sub record for a master record. Then I would see the varoius values of the 3rd col in the sub records and store a count of them in an array alongwith the value of the third col. When reading of all sub records of a Master record is done, i would take the max count from the array and the corresponding value would be filled in the master record. Then I would move to the Next Master record. Something Like using Cursors.

So does any body have an idea on this. Suggestions Please. Would be greatly appreciated.

Regards,
Manoj.
Back to top
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Wed Mar 26, 2003 12:12 pm    Post subject: Reply with quote

By pointers, I assume you mean PSBs. I have never used PL/I.

You will need 2 PCBs. The SSA for the first PCB will have the parent segment name only and will set parantage using a command code of D. Issue a GN on this PCB until you get to the end of the database.

Issue a GNP against the second PCB, restricting to the appropriate child segment, until all the sgements are processed.

Update the parent thru PCB 1.

Try looking at the IMS manuals. They tend to have examples in assembler and PL/I.
Back to top
View user's profile Send private message
manojagrawal
Beginner


Joined: 25 Feb 2003
Posts: 124
Topics: 29

PostPosted: Thu Mar 27, 2003 2:46 am    Post subject: Reply with quote

Hi Bithead,

Whats happening is all these records are part of one SEGMENT.

In that case, i am confused as to how we can do a parent child relationship. Can you please explain in more detail.

Also which would be the right Manual to use. I have looked thru and there are so many. Gets me confused. You have any particular one's to suggest?

Regards,
Manoj.
Back to top
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Fri Mar 28, 2003 9:05 am    Post subject: Reply with quote

Issue the GHU or GHN on the parent and set parentage. Issue the GNP against the child segment and process each occurrance on that segment. If there are more child segments for this parent, process them then update the parent.
Back to top
View user's profile Send private message
manojagrawal
Beginner


Joined: 25 Feb 2003
Posts: 124
Topics: 29

PostPosted: Sat Mar 29, 2003 7:36 am    Post subject: Reply with quote

Hi Bithead,

As I mentioned these are all part of one segment and do not have a parent child relationship.

However, by using 2 PCB's and with simple GU calls against the segment i did manage to get the 2 pointers that i required.

Thanks for your suggestions!!!!

Regards,
Manoj.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group