Problem solve Get help with specific problems with your technologies, process and projects.

Running scatter/gather operations

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.

Robert Harris
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

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.