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
 

 

IMS: SSA in GNP call ...

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

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Dec 05, 2007 6:49 pm    Post subject: IMS: SSA in GNP call ...
Reply with quote

Hi Guys,
May be this question sound some weird! I am very new to IMS. I am writing some COBOL-IMS program in which I will call a IMS db to fetch some data depending upon some keys. May be I am not very much clear. Refer the example below -
IMS db Stucture -
Root : SHOP
Child : CUSTOMER
Child : PRODUCT.

Code:
                            SHOP
                               |
       -------------------------------------------------------------------
      |                                                                   |
CUSTOMER                                                                  PRODUCT


SHOP is having the key field - product number - where child is a non-keyed segment.
Now in COBOL, I am making a GU call with the qualified SSA. Then I would like to know the CUSTOMER name by making a GNP call.
In this GNP call, is it required to use qualified/ unqualified SSA?
In a sentence, my question is - Is it necessary to include SSA (may be unqualified also) in GNP call where I have already made a GU call to the db? Please let me know the reason. I am waiting for it...
Back to top
View user's profile Send private message

Sandy Zimmer

Active Member


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

PostPosted: Wed Dec 05, 2007 7:02 pm    Post subject:
Reply with quote

Why is CUSTOMER a child segment if there is only 1?
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Dec 05, 2007 7:11 pm    Post subject:
Reply with quote

Sandy, this is a kind of DB structure you can say! I cannot do with this. But I would like to about my query. Pls explain ...
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Dec 05, 2007 7:15 pm    Post subject:
Reply with quote

Do you have the DBD? We need to see the SHOP and CUSTOMER definitions. In IMS, child dependent segments are defined as child segments because there can be 1 to many. Otherwise, the customer would be part of the root.
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Dec 05, 2007 8:13 pm    Post subject:
Reply with quote

Sandy, I am sorry for the fact that I tried to use a hypothetical condition. And the example I have provided above is just an imagination. I even don't have any such db. But I would like to know about the qs -
If I am having an IMS db like -
Code:

                               Root ----------- |---- Child1
                                                     | ---- Child2

Then after making a GU call in root segment, if I want to make a GNP call in Child1, is it required to include the SSA of the Child1 segment? This is my basic question and the example I have put above, I used to make my doubt more clear.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Wed Dec 05, 2007 8:15 pm    Post subject:
Reply with quote

This must be a class problem? First of all, take a look at this post (link below) and learn. I spent quite a bit of time on this and I think that it will help you. You do not need to do GNP - just read the post and then ask questions. And, from now on tell us if it is a "learning" problem.

http://ibmmainframes.com/viewtopic.php?t=26429&postdays=0&postorder=asc&start=15
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Thu Dec 06, 2007 9:47 am    Post subject:
Reply with quote

Sandy, probably u r getting me wrong -
Quote:
This must be a class problem? First of all, take a look at this post (link below) and learn. I spent quite a bit of time on this and I think that it will help you. You do not need to do GNP - just read the post and then ask questions. And, from now on tell us if it is a "learning" problem.

My question was - Is it madatory to include an SSA while making a GNP call? I faced this problem in my current project. I wrote a COBOL-IMS program where I initially hit the root segment with GU call along-with qualified SSA. After that I hit the child segment with GNP call without any SSA. Now my question is - will it work? May be it is working in my system because my IMS db structure is having 2 levels only (Root -> Child) and one to one relationship. But will it work if my db structure were having one to many relationship?
In my earlier post, I tried to put some example to make u all clear about my doubt! But alas! All those efforts were in vain-I was not able to make my question simpler rather made it little tough to understand. Sorry for that.
Waiting for your reply ... I think this time I have expressed my doubt/ question very clearly.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Dec 06, 2007 10:38 am    Post subject:
Reply with quote

Amitava,
Take the following example

Hospital
|
Ward
|
Patient

Now, if you do a GU and located the hospital segment,
and then if you are doing a GNP without any SSA, you are retreiving all the Ward segments and Patinet segments under that hospital segment. If you do a GNP with Ward SSA, you will be getting only Wards not Patients under that hospital. and the same happens with Patient SSA.
It all depends on how you want to retrieve the segments. Hope my explanation helps.
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: Thu Dec 06, 2007 3:41 pm    Post subject:
Reply with quote

To get back to your original question:

no an SSA for GNP is optional. From the first link in one of my stickies and searching for GNP you might have found this

Have fun exploring IMS.
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Thu Dec 06, 2007 4:00 pm    Post subject:
Reply with quote

Srihari, thanks a lot! Now I have got it. But here again I have some questions -
Suppose the DB structure is -
Hospital
|
---------------
| |
Ward XXXXX
|
Patient

Now my question is - If I issue a GNP call without any SSA attached with it after making a GU call in Hospital, which segment is supposed to be fetched and in which order? Will the oder be same as the segments are defined in the DBD libraries?

Please clear my doubts ...
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Thu Dec 06, 2007 4:47 pm    Post subject:
Reply with quote

First it will go to Ward segment and fetches all the patient segments in this ward and then it goes to the next ward. It traverses like this till all the wards and patients are covered under the hospital segment. Please have a look at the traversing process in IMS. Please check the stickies provided by George for more information.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Thu Dec 06, 2007 5:07 pm    Post subject:
Reply with quote

If you use SSAs down, then you do not need to set parentage. In my humble opinion, setting parentage is not necessary. It's more coding that is not needed unless you want ALL segment types under a particular parent.
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: Thu Dec 06, 2007 6:48 pm    Post subject:
Reply with quote

Srihari Gonugunta wrote:
Please check the stickies provided by George for more information.


Thank you icon_wink.gif I even did some work for him and posted this before:


no an SSA for GNP is optional. From the first link in one of my stickies and searching for GNP you might have found this
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 REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
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 Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am


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