View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Mon Jun 05, 2017 2:33 am Post subject: IMS Get last occurrence |
|
|
I've tried every variation that I can think of (but obviously not the correct one) to get the last child occurrence from an IMS database.
The relevant entry I'm trying to fetch is shown below
Quote: |
Lvl Segment Data
1 VNOAG10 01000000664
2 VNOAG20 001
2 VNOAG20 003
3 VNOAG30 201704 bla-bla
3 VNOAG30 201705 last entry <----- This is the entry I expect to be returned
|
I'm calling AIBTDLI with a qualified SSA containing the following values
Quote: |
VNOAG10 *---(VNOKG11 =01000000664)
VNOAG20 *---(VNOKG21 =003)
VNOAG30 *L
|
Each time I call AIBTDLI, I get an AJ as the return code. It's been YEARS since I did any DL/1 programmming so would appreciate any ideas/pointers as to whether I should use GU, GN or GNP on each segment level (as well as any explanations as to WHY the call isn't working). _________________ Michael |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Jun 05, 2017 10:53 am Post subject: |
|
|
misi01,
What is the call you made to get the last occurrence in the child segment? GU ?
If I remember correctly in order to get the last concurrence of the child segment, you need
1. GU call of the parent
2. GNP call of the child segment with L command code
or alternatively you can specify BOTH parent and child as Qualified SSA
PS: Why is this in DB2 section when the question is related to IMS? There is an IMS section further down. Link to IMS section
http://www.mvsforums.com/helpboards/viewforum.php?f=13 _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Tue Jun 06, 2017 4:12 am Post subject: |
|
|
I found what the problem was. It was simply because I didn't have a trailing space in the unqualified SSA and IMS was picking up the garbage in working storage AFTER my definition.
Kolusu - I missed the IMS group topic when appending. Please feel free to move this discussion there if you can _________________ Michael |
|
Back to top |
|
|
|
|