IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

IMS: SSA in GNP call ...


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Dec 06, 2007 3:41 pm
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
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
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
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: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Dec 06, 2007 6:48 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Batch call online program, EXCI task ... CICS 3
No new posts CSQBGET - Call giving completion code... COBOL Programming 3
No new posts CICS DPL call CICS 6
Search our Forums:

Back to Top