CAP service enables mainframe
Keywords:
Mainframe, REST, 3270, JSON, Robots
The context:
A company has a requirement to use data accessed via a mainframe terminal interface in a process
automation solution.
The solution:
Using CAP, the mainframe access was emulated using the 3270 Extension and made available to
other systems by exposing a REST API using JSON directly from with a CAP Agent instance.
Deployment diagram:

Why CAP:
CAP is capable of interacting with a vast array of data sources, protocols and APIs out of the box. In
this case, the built in 3270 terminal emulation for mainframes along with the built-in capability to
expose a service, made CAP the obvious choice.
The story:
Upon receipt by the business of an account closing request, many systems (including the mainframe)
need to be checked to verify that all outstanding debts and balances are cleared. As a manual
process, this takes up to an hour per account. So replacing this check with an automated one that
only flags exceptions is highly desirable. However, the IT option for creating a service directly from
the mainframe was deemed too costly to justify in the context of the benefits from the automation
project.
Using CAP, a simple screen-scraping option was used instead. Upon receiving a HTTP POST with a
JSON formatted data request, CAP will check if an existing session to the mainframe is present. If
yes, it will simply perform the required transaction codes to check for balances.
Should a mainframe session not be present, CAP will log in first, before responding.
To ensure that the mainframe is unable to be flooded with requests and to only ever keep one
session running, queuing rules were added so that at any point, requests would simply queue up and
wait for the session to become free. This approach was deemed satisfactory as the average number
of transactions per day was below 100.
Once the service was made available, a second CAP instance was used to create the end-to-end
process of checking all other systems as well as the mainframe. This ensured not only the success of
the automation project, but also made the service available to other consumers within the business
should the need arise.
Rules blocks and components used:
3370 Emulation Rules
Queuing Rules
String manipulation Rules
JSON Rules
Last updated

