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
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Tue Aug 17, 2010 6:24 pm
Reply with quote

Hi,

I have a parent segment Called LTPOROOT and its child segment is LTPOPOLH. Root contains the policy information while the LTPOPOLH contains the transaction history of the policy. A single policy ll usually have multiple transaction and hence this ll have multiple segment occurences.

I have to now change the status in root segment field and then insert the information regarding this update in the LTPOPOLH.

on LTPOROOT I am using GHU call and then REPL call to make the required update and this is happening successfully.

Now on LTPOPOLH I am using ISRT call to make a new entery for the transaction.

Now my query is GHU call needed before ISRT. If yes on which segment should i give GHU call as this is new insertion.

and ISRT call should to be qualified or unqualified.

and i am getting following error code when I used a qualified ISRT call.

TNG3VIND: STACHN RUN TERMINATED. * ABORT CODE: ACDF *
**************************
MESSAGE: INVALID DL/I STATUS CODE
SECTION: SECTION TRACE NOT IN USE
DATABASE: DTPOLDA
ACTION: ISRT
STATUS: AJ
SSA: TPOROOT (TPORKEY =IB078005004)
: EDDDDDE44EDDDDCE447CCFFFFFFFFF5
: 37696630D376925800E92078005004D
SSA: TPOPOLH (TPOPKEY = .......<)
: EDDDDDC44EDDDDCE474034853745
: 37676380D37672580E0132C756CD
TEXT: INVALID SEGMENT QUALIFICATION
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Tue Aug 17, 2010 6:26 pm
Reply with quote

Please post both of your calls.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Tue Aug 17, 2010 6:37 pm
Reply with quote

Sandy Zimmer wrote:
Please post both of your calls.


PERFORM S3-GNP-TPOPOLH-U UNTIL W1-DATABASE-FINISHED.

Im moving the key fields here.

PERFORM S15-ISRT-TPOPOLH-Q
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Tue Aug 17, 2010 6:39 pm
Reply with quote

I want to see your SSAs and your IMS calls.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Tue Aug 17, 2010 6:41 pm
Reply with quote

Quote:
PERFORM S3-GNP-TPOPOLH-U UNTIL W1-DATABASE-FINISHED.


This perform tells me that you are not POSITIONED where you think you are.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Tue Aug 17, 2010 6:46 pm
Reply with quote

Sandy Zimmer wrote:
Quote:
PERFORM S3-GNP-TPOPOLH-U UNTIL W1-DATABASE-FINISHED.


This perform tells me that you are not POSITIONED where you think you are.


ya im slight confused here regarding where to POSITION myself before inserting.

Do i need to perform insert after the first read or after erading the last record
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Tue Aug 17, 2010 6:58 pm
Reply with quote

PLEASE post your SSAs - then post the moves to the SSAs. Then post your calls.
Back to top
View user's profile Send private message
Sandy Zimmer

Active Member


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

PostPosted: Tue Aug 17, 2010 10:49 pm
Reply with quote

It's a little after noon on Tues here in the states - it's the middle of the nite in India. So, I am not expecting a reply until morning here in the states.

In the interim, please read about what is needed for a CHILD segment insert. And, where is your input coming from? Do you have a flat file that tells you the policy and transaction information? Does it have a routine for the most recent transaction date? What is the key of both the root and child segments? And, remember that a HOLD call is not needed for an insert.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Wed Aug 18, 2010 7:33 pm
Reply with quote

Sandy Zimmer wrote:
It's a little after noon on Tues here in the states - it's the middle of the nite in India. So, I am not expecting a reply until morning here in the states.

In the interim, please read about what is needed for a CHILD segment insert. And, where is your input coming from? Do you have a flat file that tells you the policy and transaction information? Does it have a routine for the most recent transaction date? What is the key of both the root and child segments? And, remember that a HOLD call is not needed for an insert.


Hi Sandy,

Now I am facing a different kind of problem...

Can u pls tell me how to position myself at the last record of the particular segment before inserting into LTPOPOLH which has many transaction for single policy.

I am doing the following things.

1. Read the policy number from input file.

2. GU call on LTPOROOT.

3. REPL on LTPOROOT to replace a field

3. GNP Call on LTPOPOLH.

without using the insert statement the job is ending fine with REPL getting executed successfully. But I am getting follpwing abend on online screen

* * * * * * * * * * * * * * * * * * * * * * * * *
* O L A S O N L I N E A B E N D *
* * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Abend..... AGD9 Program.. PTAG00 *
* *
* Terminal.. G5AA User..... NGOVIND *
* *
* Date...... 18-Aug-10 Time..... 14:56 *
* *
* * * * * * * * * * * * * * * * * * * * * * * * *
* O L A S O N L I N E A B E N D *
* * * * * * * * * * * * * * * * * * * * * * * * *

can u pls tell me the reason for the abend even without inserting
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 Aug 18, 2010 7:39 pm
Reply with quote

Why do you think you need to be at the last child segment to do your insert? I am assuming that your database is either HDAM or HIDAM - it is keyed.

Once again, I will ask you to please post your code for your calls. You also need to do a GHU not a GU - you cannot perform any updates to an existing segment without a HOLD call.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Wed Aug 18, 2010 7:50 pm
Reply with quote

Sorry i forgot to mention that... i am using a GHU call before replace...

I am using the following calls in the order mentioned.

PERFORM S1-GU-TPOROOT-Q.
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-GU
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-ROOT-Q.

PERFORM S30-GHU-TPOROOT-Q.
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-FUNC
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-ROOT-Q.

PERFORM S29-REPL-TPOROOT-U.
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-REPL
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-ROOT-U.

PERFORM S3-GNP-TPOPOLH-U
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-GNP
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-HIST-U.

Any idea on the reason for the online abend I mentioned in my previous post.
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 Aug 18, 2010 8:03 pm
Reply with quote

I have absolutely no idea what that error message indicates - it must be something in your particular environment. Where are you checking for status codes after you calls? What's in the paragraphs for the perform statements.

Why are you issuing this call? It is not needed - get rid of it.
PERFORM S1-GU-TPOROOT-Q.
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-GU
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-ROOT-Q.

Leave this call.PERFORM S30-GHU-TPOROOT-Q.
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-FUNC
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-ROOT-Q.

Where are you moving - updating your root information before the replace?PERFORM S29-REPL-TPOROOT-U.
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-REPL
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-ROOT-U.

Get rid of this - no reason for it.
PERFORM S3-GNP-TPOPOLH-U
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-GNP
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-HIST-U.

You can put your insert after your replace of the root AND after you check your return status call for the replace. You will be using 2 SSAs - ATPOSSA-ROOT-Q and unqualified for the child segment. I do need to see the key field.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 18, 2010 8:15 pm
Reply with quote

Quote:
Where are you checking for status codes after you calls?


This seems to be an attribute of most that post here.
if they would check their status codes (cobol, db2, rexx, anything.....)
there would be less traffic on this board.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Wed Aug 18, 2010 8:32 pm
Reply with quote

hi my insert looks like below

S15-ISRT-TPOPOLH-U
CALL 'HAZM00' USING CAZMAREA
WAZ0SERV-DLI-FUNC
TPOL-DA-PCB1-MASK
WAZ0SERV-IO-AREA
ATPOSSA-ROOT-Q
ATPOSSA-HIST-U.

01 ATPOSSA-ROOT-Q.
05 FILLER PIC X(08) VALUE 'TPOROOT'.
05 FILLER PIC X VALUE '('.
05 FILLER PIC X(08) VALUE 'TPORKEY'.
05 ATPOSSA-ROOT-ROP PIC XX VALUE '='.
05 ATPOSSA-ROOT-KEY PIC X(11) VALUE SPACES.
05 FILLER PIC X VALUE ')'.

I am passing the key to this segment and ATPOSSA-HIST-U is an unqualified call. But i am getting the following abend that it already exists.

MESSAGE: INVALID DL/I STATUS CODE
SECTION: SECTION TRACE NOT IN USE
DATABASE: DTPOLDA
ACTION: ISRT
STATUS: II
SSA: TPOROOT (TPORKEY =IB099828649)
: EDDDDDE44EDDDDCE447CCFFFFFFFFF5
: 37696630D376925800E92099828649D
SSA: TPOPOLH
: EDDDDDC4
: 37676380
TEXT: SEGMENT TO BE INSERTED ALREADY EXISTS
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 Aug 18, 2010 8:41 pm
Reply with quote

OK - we are making some progress. How do you build the NEW key for the child segment before you insert it? I will assume that it is some kind of date/time stamp.

Some things to think about - what if - when you try to get the root segment and you get a "GE" - not found - are you putting out an error report and going on to the next?

What are you going to do if the child segment already exists? You need to include coded routines for all unexpected status codes.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Wed Aug 18, 2010 8:58 pm
Reply with quote

Sandy Zimmer wrote:
OK - we are making some progress. How do you build the NEW key for the child segment before you insert it? I will assume that it is some kind of date/time stamp.

Some things to think about - what if - when you try to get the root segment and you get a "GE" - not found - are you putting out an error report and going on to the next?

What are you going to do if the child segment already exists? You need to include coded routines for all unexpected status codes.


For ur first question if get GE as return code the program writes to error report and it terminates.

Since ISRT contains Qualified call for root segment and unqualified call for the child one its obvious that the other child segments too have same root key. What is the method now to insert 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 Aug 18, 2010 9:06 pm
Reply with quote

Quote:
Since ISRT contains Qualified call for root segment and unqualified call for the child one its obvious that the other child segments too have same root key. What is the method now to insert it?


A child segment WILL NOT have the same key as the parent. I'm going to ask you to post the DBD. And, your SSAs have nothing to do with updating or inserting key fields - they are "segment search arguments".
The qualified SSA for the root tells IMS that you are positioning yourself at that root. The unqualified SSA for the child tells IMS that you are inserting that type of child segment. I won't confuse you by telling you that a parent can have many types of child segments.

You need to build the segment for the child - including the key. So, post your DBD (database definition) and the logic to build that segment.
Back to top
View user's profile Send private message
narasimha.g

New User


Joined: 10 Sep 2009
Posts: 68
Location: Liverpool

PostPosted: Thu Aug 19, 2010 7:53 pm
Reply with quote

Hi Sandy,

Thank u soo much... the program is working fine now... got many doubts clarified from ur posts... Thanks for the help...

Sandy is there any means to stop at the last record of the chind segment... how to find the last record while using a GNP call on child segment....

My requirement is I have a child segment with 10 occurences... I have to stop at the 10th occurence and copy the values...
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 Aug 19, 2010 10:15 pm
Reply with quote

As I've said many times here - much to the dismay of others - I learned NOT to use GNP. I much prefer qualified SSAs all the way down to an unqualified SSA for the segment you are trying to read using GN. You know, of course, that there can be many different types of child segments on the same level for the same parent - right?

Let me understand this - you want the 10th child segment? How do you know that there will be 10? Or, do you want the LAST child segment?
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 3:18 pm
Reply with quote

Sandy Zimmer wrote:
As I've said many times here - much to the dismay of others - I learned NOT to use GNP. I much prefer qualified SSAs all the way down to an unqualified SSA for the segment you are trying to read using GN. You know, of course, that there can be many different types of child segments on the same level for the same parent - right?

Let me understand this - you want the 10th child segment? How do you know that there will be 10? Or, do you want the LAST child segment?


ok... ll try NOT to use GNP here on.... :-)

ya i want the last child segment....
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 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
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