MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IMS Get last occurrence

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Mon Jun 05, 2017 2:33 am    Post subject: IMS Get last occurrence Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Mon Jun 05, 2017 10:53 am    Post subject: Reply with quote

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 - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Tue Jun 06, 2017 4:12 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group