How can a "linked" CICS program handle multiple concurrent requests and only return the completion result of the caller once it has completed the task for that particular request?
This is a general problem is CICS -- called scatter/gather. You want to be able to XC LINK to a program and then that program initiates n transactions, waits for them all to complete, extracts data and then returns to the calling program with a Commarea composed of the n transaction results.
This is not very easy to do in CICS, as it involves the use of ECBs to check that the n transactions have actually ended and the use of shared storage to hold the individual returned results. All of which is not easy to code, test or get correct.
However, in general, I recommend using BTS services to do all the hard work for this scatter/gather operation. You do not have to invent mechanisms to control and schedule the n transactions or to process the results via shared storage areas.
In essence, you start a BTS process and use the event/activity interfaces to create an activity for each of the n transactions. When they return (with data for each in a separately named container) you can then track these n things via BTS -- so ensuring they have all run and the return data is available for presentation to the invoking program.
This BTS process, running the scatter/gather transactions, can run asynchronously or synchronously so you have the ability to do other things whilst waiting for the scatter/gather operations to complete.
CICS Technical Strategist -- CICS expert at Search390.com
Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our .VO7aaqqaAFk.0@/search390>discussion forums.
Dig Deeper on IBM system z and mainframe systems
Related Q&A from Robert Crawford
For better mainframe capacity planning, how do I convert CPU hours to MIPS? And is there a way to calculate the relationship between MIPS and MSUs? Continue Reading
I have two years of experience in mainframe technology, currently working as a mainframe developer. I want to change to Java technology. Continue Reading
I want to replicate DB2 from the mainframe to an AIX box since it's cheaper and the copy can be used for testing. Is this possible? Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.