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

What is diff b/w GN and GU calls in case of qualified SSA ?


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tanuj

New User


Joined: 08 Jan 2007
Posts: 2
Location: pune

PostPosted: Mon Nov 08, 2010 12:18 am
Reply with quote

Hi,

Could you please let me know the diff b/w below two calls as both will give the same result.


Hospital
|
Ward
|
Patient


1)
GU PATIENT (PATNAME = KRISH)

2)
GN PATIENT (PATNAME = KRISH)


Thanks,
Tanuj
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 Nov 08, 2010 6:54 pm
Reply with quote

If that is the ONLY SSA in your call and the patient is a child of ward which is a child of hospital, you will not get anything with a GU.

THINK about it.
Back to top
View user's profile Send private message
tanuj

New User


Joined: 08 Jan 2007
Posts: 2
Location: pune

PostPosted: Wed Nov 10, 2010 1:22 am
Reply with quote

icon_eek.gif
As per my understanding, its surely return a qualified patient segment.

Hospital
|
Ward
|
Patient


GU PATIENT (PATNAME = KRISH)

In this case, as we have not mentioned any SSA for Hospital and Ward, DL/I will assume an Unqualified SSA for each missing or skipped segment types.

Could you please check and let me know ?
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 Nov 10, 2010 3:19 am
Reply with quote

I do not need to CHECK - I KNOW!

Hospital is the root - there can be 1 to many ward segments beneath that root. There then can be 1 to many patient segments beneath that ward.

The patient name "KRISH" may or may not be unique - it quite possibly can exist in may hospitals and within those many hospitals - in many wards.

IMS does not ASS-U-ME!

You cannot do a GU to a child segment or a segment down the chain without qualifying it's parent and above. THINK - IMS is positional - not relative.
Back to top
View user's profile Send private message
Suthagar

New User


Joined: 01 Jul 2005
Posts: 26
Location: Chennai

PostPosted: Thu Nov 11, 2010 2:03 am
Reply with quote

Hi Tanuj,

Though it is a bad way of coding (Qualified SSA for a 2nd level child segment without having an SSA for Parent and 1st level child), The code works as follows:

1. The first occurrence of the root segment (Hospital) would be fetched.
2. Under the fetched Hospital the first occurrence of the Ward segment would be fetched next.
3. It will search for the value PATIENT (PATNAME = KRISH) in the Patient segment.

Note:
When you are setting position in IMS database, the calls GU and GN works same (There is no difference).

Cheers,
Suthagar.S
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 11, 2010 2:58 am
Reply with quote

Quote:

IMS does not ASS-U-ME!


36_2_35.gif
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Zunit Test case editor error Testing & Performance 4
No new posts Sort on different fields, removing du... SYNCSORT 8
No new posts usage of CASE in WHERE clause DB2 10
Search our Forums:

Back to Top