In the previous module, we discussed cable running inside of CICS, an application programming interface, the API. We saw how easy it was to include command level, exact CICS commands, in a COBOL program to request for CICS services. As CICS is involved with features been announced with every release, the API has been enhanced to provide support for these new features. For example, the instruction of web commands to support web protocols and commands to support channels and containers. Let's have a look at three new features. So CICS CS 5 fall introduces a set of APIs to simplify asynchronous programming for application programmers. To explain what we mean by this, let's look an example. Debra goes to the market to shop on a Saturday morning. She parks in the short duration car park, so she only has a limited amount of time to complete her shopping. She needs to buy bread and cakes from the baker, eggs from the butcher and fruit and vegetables from the grocers. She goes to the shops in sequence, first the baker, then the grocer and finally the butcher. Unfortunately in the bakers, she must wait for the bread to come out of the oven, this means she takes too long and she gets a parking fine. The following Saturday she instead takes her three sons, Will, Martin and Jim with her. She sends Will to the bakers to buy bread and cakes, Martin by the fruit and vegetables and Jimmy sends the butchers to buy the eggs. She waits in her favorite cafe until they complete the tasks. She's asked all three boys to text her when they finish shopping so that she can arrange a place to collect them. When they've all responded, Debra finishes her coffee, jumps in her car and goes off to collect them, a much better experience for Debra. This example demonstrates the main principles of asynchronous programming. Firstly, the ability to split work into separate tasks that can be run independently. Here it was sending the three boys off to different shops. Secondly, trace the completion of the asynchronous work. In this case, the boys will sent their mama texts when they'd finish their shopping. And finally, and this one wasn't demonstrated by the example but it is still important, is to pass data safely between the main and asynchronous tasks. To be fair, asynchronous program has been around for a while as a concept and application programmers have used various programming techniques, such as exec CICS start an exec CICS delay with some kind of to test if the code program had completed or an exec CICS wait and post-combination. But these techniques have proven to be nontrivial and notoriously difficult to implement for several reasons, including time in windows. The aim of the CICS asynchronous APIs is to simplify this process for the application programmer or providing the function natively within CICS. CICS APIs address the three main aspects just mentioned using four API commands. We've got EXEC CICS RUN TRANSID, which initiates a child transaction that runs asynchronously, EXEC CICS FETCH CHILD to inquire on the status for specific child task, EXEC CICS FETCH ANY to inquire on the status of any completed child task, which is not yet been fetched, and EXEC CICS FREE CHILD to forget a child has not responded. And, yes, we're also talking about programming here. And the existing EXEC CICS PUT CONTAINER, an EXEC CICS GET CONTAINER commands pass data between asynchronously running processes. So, how does this work? Consider apparent task running some business logic. At some point, a child task is run using EXEC CICS RUN TRANSID and the parent passes later to the child in a put container. The child begins to run in a separate task in the same region as the parent. Importantly, the parent can continue processing independently of its child. It is not blocked by the child, as would happen if the parent had linked to the child. When the parent is ready for the result from the child, it issues a fetch child and it waits. It does not have to continuously poll for the result. The child can issue CICS API and can link to a remote region or invoke a web service. And when the child task completes, the parent is resumed. The child passes data back to its parent in a container. To recap, the new API provides easy to implement asynchronous programming from your application. You don't need to worry about how it works just that you can split off independent units of work from the main program but still have the ability to track their progress. [MUSIC]