Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 2 Thu Jan 12, 2017 12:02 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us