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

How to return to the parent from the child in IMS


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

New User


Joined: 15 Nov 2012
Posts: 47
Location: India

PostPosted: Fri May 10, 2013 1:13 pm
Reply with quote

Dear Team,

I have a requirement wherein, a database has a parent and 2 children.

PARENT SEGMENT = SEGPADR
CHILD 1 = SEGMES
CHILD2 = SEGHIJO ( in the same order).


Now, the requirement is, to search for the values in SEGPADR, then SEGMES and then SEGHIJO.
There is a field IMESANO in the segment SEGMES which needs to be assigned to some other field in the output file.
But. the segment SEGMES has many SEGHIJOs under it.

My requirement is to first check SEGPADR and write its fields into the 1st output file.

Next, it should check for SEGMES segment and write IMESANO values to all the records and then look for the records in SEGHIJO and write them.

But, what is happening now is, It is only looking for first IMESANO value in SEGMES (There are many SEGMES under SEGPADR) and assigning this value to all the records. It is not looking for the next SEGMESes and writing the records, while it should do so.

I have used GNP call to retrieve the data from SEGMES and SEGHIJO.

Please let me know incase you need more information.
The piece of code of SEGMES:

B10_UNLOAD_SEGMES: PROC;
PROC_NAME = 'B10_UNLOAD_SEGMES';
DO WHILE(EOF_GMES = '0'B);
PUT SKIP LIST ('B10_UNLOAD_SEGMES');
CALL PLITDLI(FOUR,FUNC_GNP,IVAMOD_PCB,
SEGMES_IO_AREA,
SEGMES_UNQUAL_SSA);
PUT SKIP LIST ('STATUS1' || IVAMOD_PCB.IVAMOD_STAT_CODE);
SELECT (IVAMOD_PCB.IVAMOD_STAT_CODE);
WHEN (OKAY) DO;
PUT SKIP LIST('IFMONTH' || SEGMES_IO_AREA.IMESANO);
EOF_HIJO = '0'B;
CALL B10_UNLOAD_SEGHIJO;
END;
WHEN (EODB) DO;
PUT SKIP LIST ('NOT FOUND1');
EOF_GMES = '1'B;
END;
WHEN (NOTFOUND) DO;
PUT SKIP LIST ('NOT FOUND2');
EOF_GMES = '1'B;
END;
OTHERWISE DO;
WS_FUNCTION_CALL = FUNC_GNP;
RETURN_CODE = 8;
SIGNAL CONDITION (ERRDLI);

Thanks a lot in advance.
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts REXX GETMSG does not return £HASP880... CLIST & REXX 2
No new posts RXSUBCOM Return Codes / Documentation CLIST & REXX 6
No new posts How to: PK does not exist in several ... DB2 6
Search our Forums:

Back to Top