Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to return to the parent from the child in IMS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> IMS DB/DC
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    Post subject: How to return to the parent from the child in IMS
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    IBMMAINFRAMES.com Support Forums -> IMS DB/DC All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting GG return code abdulrafi IMS DB/DC 2 Tue Apr 10, 2018 12:31 pm
No new posts Conditional setting of return-code af... sanvan COBOL Programming 9 Wed Jan 31, 2018 11:05 pm
No new posts IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts EXIT or RETURN cvnlynn CLIST & REXX 18 Wed Jul 19, 2017 2:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us