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

IMS DB - Is GHU call needed for ISRT action


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

Active Member


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

PostPosted: Fri Aug 20, 2010 3:50 pm
Reply with quote

There are a couple of ways to do this. The easiest and most straightforward is to use the qual SSA for the parent and unqual SSA for the child. When you get either "GE" - end of child segments or "GB" - end of database, you know that you have read the last segment.

As you were looping thru those segments, your child segment was returned into your IO area. Your IO area will contain the data from your last successful call.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Fri Aug 20, 2010 4:08 pm
Reply with quote

Sandy Zimmer wrote:
There are a couple of ways to do this. The easiest and most straightforward is to use the qual SSA for the parent and unqual SSA for the child. When you get either "GE" - end of child segments or "GB" - end of database, you know that you have read the last segment.

As you were looping thru those segments, your child segment was returned into your IO area. Your IO area will contain the data from your last successful call.


ohh k... thanks for this.. It ll be very much helpful to me... as i was reading the child till end of child segments and in each read i used to replace the old values with new values in temperory variables...
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Fri Aug 20, 2010 6:44 pm
Reply with quote

You can also move your IO data to a "saved" IO child segment after each successful read. Then replace the old values with the new values before your insert.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Sat Aug 21, 2010 5:03 pm
Reply with quote

One more thing you need to think about. What if there are no child segments? Is there enough data on your input file to populate that first child segment?
Back to top
View user's profile Send private message
nareshkp

New User


Joined: 26 Sep 2007
Posts: 28
Location: Bangalore

PostPosted: Mon Aug 23, 2010 2:12 pm
Reply with quote

You can also think about using command code L to retrive the last occurance of the child segement directly...
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 Aug 23, 2010 5:18 pm
Reply with quote

Quote:
You can also think about using command code L to retrive the last occurance of the child segement directly...


I said simple and straightforward. Always program so that your code is easily maintainable - think of that next person.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Mon Aug 23, 2010 7:31 pm
Reply with quote

Quote:
said simple and straightforward. Always program so that your code is easily maintainable - think of that next person.


But i read somewhere, that each DLI call is costly. So we should try saving dli calls.

Yes, but when it comes to maintainability, I am not very sure how the command code would be interpreted if there is a change in underlying database organisation, especially if underlying database is a HS (Hierarchical sequential) database, given that it does not use pointers.
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 Aug 23, 2010 7:42 pm
Reply with quote

What do you think IMS is doing behind the scenes? That database org will not be changing to HS - take my word.

Try it anyway you can think of - then pick the best.
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
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 Help needed to assemble IMS sample co... ABENDS & Debugging 4
Search our Forums:

Back to Top