IBM Systems Magazine, Mainframe - May/June 2017 - 45

this command the CICS program
returns a unique identifier of the
child task. This command, much
like sending an email to someone
asking to perform some work, is
non-blocking. Once sent, you can
carry on with your own work. The
same is true of this parent task in
CICS: it's free now to continue its
own processing while this child
task carries out its work.
When the parent task needs
the results from the child, it can
wait (and block its processing)
until the child has returned with
information, much like checking
your email and waiting for an
email to turn up in your inbox.
To achieve this, use the first
FETCH command:
EXEC CICS FETCH

This will block the parent task's
processing until a result comes
back, whichever responds soonest.
At the start of the article,
adhering to SLAs was discussed.
To this end, when the parent
sits and waits for a child
task to respond, it can't wait
forever. To allow for this, both
FETCH commands also support
two keywords: TIMEOUT(...)
and NOSUSPEND. TIMEOUT
takes as input a time value (in
milliseconds) the parent is happy
to wait. NOSUSPEND instructs
the parent to check its inbox for
a reply from a child, but to not sit
and wait: Perform a non-blocking
operation, not the default
blocking action. If the parent task
wants to continue waiting, it can
issue another FETCH command.

CHILD(...) CHANNEL(...)

Simple Model
The child identifier from the
earlier RUN TRANSID command
is given as input, to state which
child's results you want in
particular. As with RUN TRANSID,
CHANNEL is an optional keyword;
you might want to have work
performed on the side, with
no information being passed
specifically. FETCH CHILD will
always state the completion
status of the child though (an
improvement over START), and if
the child abended, its abend code.
While we've only described
the starting of one child task
here, many can be started. For
example, calling external credit
checking agencies. You might
send the same information to
several agencies, and want to
get the results of the one that
responds soonest. Starting the
child tasks is easy: issue multiple
RUN TRANSID commands. To
get the results of the one that
responds quickest, use the
FETCH ANY command:
EXEC CICS FETCH ANY(...)
CHANNEL(...)

As another idea of this API's
application, consider the upsell.
You're writing an application for
a bank, returning a user's recent
transactions, account balance,
etc. You'd like to be able to
upsell the customer by offering
them a credit card, but you don't
want to delay the displaying of
the page. To solve this problem,
you could start a task in CICS
charged with collecting the
recent transactions and account
balances; this data might be
returned by separate programs
running in your CICS region.
You can use EXEC CICS RUN
TRANSID twice to have separate

More Resources
Read a post about the new feature:
ibm.co/2kVY5ef
Example code on GitHub:
bit.ly/2lD2OFV
Visit the CICS Knowledge Center:
ibm.co/2miRk7g

systems collect this data and
return it to you. Issue EXEC
CICS RUN TRANSID again for
the upsell child task. Now you
need to wait for both of the
required children (e.g., account
balance and recent transactions)
to return, (e.g., two seconds).
This can be specified with the
TIMEOUT keyword on your
FETCH commands. Once you
have this data, just before you
return and display that data, you
can quickly inquire on the third
child, giving you the results of
the upsell.
Issue an EXEC CICS FETCH
CHILD NOSUSPEND, so you don't
hang around waiting. If the child
comes back with upsell results,
you can add that to the page to
display too; if not, perhaps just
display a generic credit card
advertisement, not tailored to
this user.
While these new CICS API
commands fit a conceptually
simple model, they are very
powerful, and can potentially help
to reduce application response
time. All of this is done without
managing threads, locks, shared
queues or cleaning up storage.

Know the Wait Time
In this article we've introduced
the CICS asynchronous API
commands that are part of CICS
TS V5.4 open beta. EXEC CICS
RUN TRANSID allows you to
start a child task, much like
EXEC CICS START, but also hold
on to a unique identifier of this
child task. With this identifier,
you can issue EXEC CICS FETCH
CHILD or EXEC CICS FETCH
ANY, to sit and wait for a specific
child task to complete, or any
child task, respectively.
With the addition of a
TIMEOUT keyword on the API
commands themselves, you can
gain control in a clearer context
of how long a program is willing
to wait for responses.
ibmsystemsmag.com MAY/JUNE 2017 // 45


http://ibm.co/2kVY5ef http://www.bit.ly/2lD2OFV http://ibm.co/2miRk7g http://www.ibmsystemsmag.com

Table of Contents for the Digital Edition of IBM Systems Magazine, Mainframe - May/June 2017

Table of Contents
Editor's Desk: Blockchain's Assets
IBM Perspective: The Foundation for Trust in Blockchains
Infographic: Securing Your Blockchian: The details that matter
Techbits: Spurring Economic Growth in Africa
Partner PoV: Current Demand: Modernize environment and applications to stay competitive
R&D: Cognitive Conditioning: How IBM researchers use machine learning to make storage smarter
Cover Story: The Business of Blockchain: The ledger technology is set to streamline markets and transform industries
Feature: Added Security: IBM delivers additional protection for blockchain
Feature: Shared Information: Blockchain works with systems of record to integrate data
TECH Showcase: To Serve and Protect: IBM Lab Services for z Systems and LinuxONE helps clients stay vigilant against data hackers
Administrator: Logical Process: IBM CICS asynchronous API allows for more natural program creation
Solutions: Mainframe Operations Intelligence, CA Technologies; GIT for IBM z/OS, Rocket Software; SMA_RT Software V3.3.005, Type80 Security Software Inc.; Topaz for Total Test, Compuware Corporation
Stop Run: From Military to Mainframe: McLaughlin defies the odds with determination and hard work
Reference Point - Global Events, Education, Resources for Mainframe
2017 Mainframe Solutions Edition
IBM Systems Magazine, Mainframe - May/June 2017 - Intro
IBM Systems Magazine, Mainframe - May/June 2017 - Cover1
IBM Systems Magazine, Mainframe - May/June 2017 - Cover2
IBM Systems Magazine, Mainframe - May/June 2017 - 1
IBM Systems Magazine, Mainframe - May/June 2017 - Table of Contents
IBM Systems Magazine, Mainframe - May/June 2017 - 3
IBM Systems Magazine, Mainframe - May/June 2017 - 4
IBM Systems Magazine, Mainframe - May/June 2017 - 5
IBM Systems Magazine, Mainframe - May/June 2017 - Editor's Desk: Blockchain's Assets
IBM Systems Magazine, Mainframe - May/June 2017 - 7
IBM Systems Magazine, Mainframe - May/June 2017 - IBM Perspective: The Foundation for Trust in Blockchains
IBM Systems Magazine, Mainframe - May/June 2017 - Infographic: Securing Your Blockchian: The details that matter
IBM Systems Magazine, Mainframe - May/June 2017 - Techbits: Spurring Economic Growth in Africa
IBM Systems Magazine, Mainframe - May/June 2017 - 11
IBM Systems Magazine, Mainframe - May/June 2017 - Partner PoV: Current Demand: Modernize environment and applications to stay competitive
IBM Systems Magazine, Mainframe - May/June 2017 - 13
IBM Systems Magazine, Mainframe - May/June 2017 - R&D: Cognitive Conditioning: How IBM researchers use machine learning to make storage smarter
IBM Systems Magazine, Mainframe - May/June 2017 - 15
IBM Systems Magazine, Mainframe - May/June 2017 - 16
IBM Systems Magazine, Mainframe - May/June 2017 - 17
IBM Systems Magazine, Mainframe - May/June 2017 - Cover Story: The Business of Blockchain: The ledger technology is set to streamline markets and transform industries
IBM Systems Magazine, Mainframe - May/June 2017 - 19
IBM Systems Magazine, Mainframe - May/June 2017 - 20
IBM Systems Magazine, Mainframe - May/June 2017 - 21
IBM Systems Magazine, Mainframe - May/June 2017 - 22
IBM Systems Magazine, Mainframe - May/June 2017 - 23
IBM Systems Magazine, Mainframe - May/June 2017 - 24
IBM Systems Magazine, Mainframe - May/June 2017 - 25
IBM Systems Magazine, Mainframe - May/June 2017 - 26
IBM Systems Magazine, Mainframe - May/June 2017 - Feature: Added Security: IBM delivers additional protection for blockchain
IBM Systems Magazine, Mainframe - May/June 2017 - 28
IBM Systems Magazine, Mainframe - May/June 2017 - 29
IBM Systems Magazine, Mainframe - May/June 2017 - 30
IBM Systems Magazine, Mainframe - May/June 2017 - 31
IBM Systems Magazine, Mainframe - May/June 2017 - Feature: Shared Information: Blockchain works with systems of record to integrate data
IBM Systems Magazine, Mainframe - May/June 2017 - 33
IBM Systems Magazine, Mainframe - May/June 2017 - 34
IBM Systems Magazine, Mainframe - May/June 2017 - 35
IBM Systems Magazine, Mainframe - May/June 2017 - 36
IBM Systems Magazine, Mainframe - May/June 2017 - TECH Showcase: To Serve and Protect: IBM Lab Services for z Systems and LinuxONE helps clients stay vigilant against data hackers
IBM Systems Magazine, Mainframe - May/June 2017 - 38
IBM Systems Magazine, Mainframe - May/June 2017 - 39
IBM Systems Magazine, Mainframe - May/June 2017 - 40
IBM Systems Magazine, Mainframe - May/June 2017 - 41
IBM Systems Magazine, Mainframe - May/June 2017 - 42
IBM Systems Magazine, Mainframe - May/June 2017 - 43
IBM Systems Magazine, Mainframe - May/June 2017 - Administrator: Logical Process: IBM CICS asynchronous API allows for more natural program creation
IBM Systems Magazine, Mainframe - May/June 2017 - 45
IBM Systems Magazine, Mainframe - May/June 2017 - Solutions: Mainframe Operations Intelligence, CA Technologies; GIT for IBM z/OS, Rocket Software; SMA_RT Software V3.3.005, Type80 Security Software Inc.; Topaz for Total Test, Compuware Corporation
IBM Systems Magazine, Mainframe - May/June 2017 - 47
IBM Systems Magazine, Mainframe - May/June 2017 - Stop Run: From Military to Mainframe: McLaughlin defies the odds with determination and hard work
IBM Systems Magazine, Mainframe - May/June 2017 - Cover3
IBM Systems Magazine, Mainframe - May/June 2017 - Cover4
IBM Systems Magazine, Mainframe - May/June 2017 - Reference Point - Global Events, Education, Resources for Mainframe
IBM Systems Magazine, Mainframe - May/June 2017 - 2017 Mainframe Solutions Edition
IBM Systems Magazine, Mainframe - May/June 2017 - SE2
IBM Systems Magazine, Mainframe - May/June 2017 - SE3
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20191112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/relevantz_20190102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/2019mfse
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20181112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/2018mfse
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20171112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170910_v2
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_sesupp
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_linuxsupp
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20161112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/MainframeSecurity
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20151112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150910_se
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150910
http://www.ibmsystemsmagmainframedigital.com/MFSkills
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150506_supp
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20141112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140910_v2
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_gt_201405
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/BigData
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20131112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130910_v2
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20121112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/buyersguide2013
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/ibmsystems_mainframe_2012bg
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20111112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20101112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100910_bg
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20091112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20090910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20090708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20090506
http://www.nxtbook.com/nxtbooks/ibmsystemsmag/mainframe_20090304
http://www.nxtbook.com/nxtbooks/mspcomm/ibmsystems_mainframe_200901
http://www.nxtbookMEDIA.com