Aug 20 ’12

Using CICS Tools to Modernize Traditional CICS Applications

by Chris Rayns, Eric Higgins & Peter Siddell  in Enterprise Tech Journal

IBM CICS Transaction Server (TS) builds on z/OS and IBM System z facilities to provide transaction processing with high availability and scalability at a low cost per transaction and support large transaction volumes with a fast, consistent response time. Many organizations run proven but old CICS applications. New features in z/OS and CICS TS enable these existing applications to meet modern application requirements such as lack of redundancy, ease of scalability, and high availability. 

This article details what you should know about using CICS tools to modernize a traditional CICS application.

Modernizing GENAPP

An application can be modernized by converting it from a single-region architecture to a multi-region architecture so the application is available in multiple locations and continuous operation becomes possible. The locations can be different CICS address spaces or even z/OS Logical Partitions (LPARs) spread across a sysplex.

Consider a sample application, GENAPP, available with the IBM GENAPP CB12 SupportPac. This CICS COBOL application simulates insurance transactions such as creating and managing customer and policy data. The initial GENAPP model runs in a single region with data stored in VSAM files and IBM DB2 tables.

Using IBM CICSPlex System Manager (CICSPlex SM), GENAPP moves from a single- to a four-region model. The application, presentation, and data access layers are separated into unique address spaces. Data moves from VSAM to DB2 so it can be accessed via DB2 SQL calls—without changing existing VSAM-based applications that access this data.   

Understanding Your Application

Before you can modernize an application, you need to explore the resources it’s comprised of, including programs, transactions, files, tables, or Temporary Storage Queues (TSQs), and how these resources interact.

In a dynamic routing environment, you need to identify inter-transaction and transaction-system affinities and know whether they prevent specific transactions from routing to particular Application-Owning Regions (AORs), or require specific transactions to route to a particular AOR. With this information, you can split workloads efficiently and move applications across CICS regions accordingly.

IBM CICS Interdependency Analyzer (IA) provides this insight. It captures information from running CICS applications and stores it in a relational database. It identifies resource dependencies, resource affinities, and other key information that’s needed before you move an application into a CICSPlex. CICS IA records the inter-dependencies between resources such as files, programs, IBM WebSphere Message Queues (WMQs), DB2 tables, and transactions. You can evaluate data for resource affinities and CICS IA can generate affinity group information for input into CICSPlex SM.

The CICS IA plug-in to the IBM CICS Explorer provides a rich query interface to analyze the collected data without the need to write your own SQL. CICS IA also provides batch reporting facilities to analyze the data.

Analyzing Resource Dependencies

In GENAPP, customer agents use the SSC1 transaction for Inquiry and Add functions on the customer file, KSDSCUST. You can use the CICS IA Explorer plug-in to show the resources involved with the transaction.

In the IA perspective in the CICS Explorer, under the Transactions tab, right-click the SSC1 transaction and select Uses Resources. All the programs, temporary storage queues, maps, files, and other resources involved with the SSC1 transaction are shown in the Uses tab in the Resources Used window (see Figure 1).

You can use the CICS IA Command Flow feature to assess any differences in transaction or program flows. This feature captures all CICS, DB2, IBM IMS, and IBM WebSphere MQ commands—in chronological order—and related information.

In GENAPP, the command flows show that the Inquiry and Add functions each start different programs and that the Inquiry function reads the KSDSCUST file, but the Add function writes to it.

Analyzing Resource Affinities

CICS IA detects affinities and provides query capabilities to analyze existing affinity groups (see Figure 2). CICS IA also includes a batch affinity reporter you can use to identify the affinity on specific resources (e.g., the GENACUSTNUM temporary storage queue). CICS IA Affinities Reporter also creates a file of basic transaction affinity groups for input to the CICS IA Builder, which builds affinity transaction group definitions that can be input to CICSPlex SM.

Building the CICSPlex Infrastructure

For the CICSPlex infrastructure, you need CICSPlex SM, which provides flexible management of the CICS infrastructure. It lets you add or remove additional CICS regions dynamically, based on workload changes. CICS Deployment Assistant (DA) helps provision CICS regions in a CICSPlex environment.

You need to set up address spaces for the CMAS (a dedicated CICS system that manages a CICSPlex) and the Web User Interface (WUI) server (a CICS system that acts as a Web server for the WUI into CICSPlex SM) on the host. For detailed instructions, see the CICS Information Center.

After the two address spaces are defined, you can use the definitions in the CNTL data set of member CPSMDE2 in the IBM GENAPP CB12 SupportPac to define the CICS and CICSPlex Regions (see Figure 3). When those definitions are in place, you can expand the single CICS region and develop it into a multi-region architecture (see Figure 4).

You can use CICS DA to clone your existing region into the three individual regions. You then change the CICS System Definition Data Set (CSD) resource definitions accordingly. You can also use CICS DA to discover what subsystems are on your LPAR.

You can use CICS DA to obtain more information about your environment:

1. Use the CMCI interface to connect to the WUI server.
2. In the Create CICS Deployment Assistant Project window, enter a project name (in the example, WinMVS2F) and use Browse to set the target directory.
3. Click Discover MVS Images, then Next.

The resulting DA Projects window shows a new project that contains all the subsystems on your MVS image with entries for the CICSPlex and WUI server (see Figure 5).

You can use CICS DA to add the new CICS regions to the CICSPlex:

1. In the DA Projects window, select CICS Regions - Unmanaged and ensure there’s a START policy in force for the desired region. You can check for a policy by specifying a command or batch data set for the Job Control Language (JCL) member.
2. Click Add to CICSPlex and add the selected region to the CICSPlex. You can select an entry to prepare your CICSPlex to include multiple types of regions (i.e., TORs or AORs).

You can also create groups. This action establishes a SYSGRP definition in CICSPlex SM so you can add your region to the appropriate group for continuous availability. To create the groups, you can use CICS DA to clone a region type such as an AOR.

Cloning CICS Regions

1. Use CICS DA to activate the cloning wizard. Enter the new CICS Applid, CICS Sysid, and MAS name, then click Next.
2. In the Data set selection window, select the check boxes in the Share column for the required attributes for the new region, then click Finish.

After you confirm the new data set names, CICS DA submits a job to create them. You need to customize the new region (e.g., to assign SYSIN parameters), but much of the process is automated. From here, you can add the new CICS region to the CICSPlex.

Managing Resource Definitions

You can migrate CICS resource definitions by using CICS Configuration Manager (CM) for z/OS to convert from CSD into CICSPlex SM Business Application Services (BAS) resources. In this way, you can populate your new multi-region environment with a consistent set of definitions that support the new architecture.

To convert CICS resources:

1. Use the CICS CM plug-in for the CICS Explorer to open the Groups window and select the CSD group that contains your resources. The resulting display shows the groups that are currently associated with the GENAPP application and the artifacts required to support the new application.
2. Right-click a CSD group, then select Show all resources to see the programs in the application (see Figure 6).
3. You can use the Interactive System Productivity Facility (ISPF) interface to select all the resources in a group and copy them into the target group in the CICSPlex SM data repository. This transfer creates the resources in a BAS definition format and makes them available for deployment across the CICSPlex.

To migrate resource definitions, identify all the artifacts that constitute the application and populate a change package in CICS CM:

1. Open the ISPF interface to CICS CM. All the resources in the CSD groups you installed for the application are displayed. To select a resource for packaging, enter P next to each entry (see Figure 7).
2. Define any additional migration rule sets and transform rules for those resources. For example, you can move resources from the CSD file referenced by the REDDVA42 CICS region to the CSD file referenced by the REDDVB42 CICS region.
3. Specify any transformations. For example, you can change the data set name of the KSDSCUST file resource from DEVELOP to PRODUCT so that it’s identified correctly after migration.

Moving VSAM Data to DB2

You can use CICS VSAM Transparency (VT) to migrate KSDS and RRDS data sets to DB2 without changing existing VSAM-based applications. The data is then open to new uses using regular DB2 SQL calls. Because the programs are unchanged, you need to test only that the migrated data is in the correct format and the programs can access the DB2 data successfully.

You can use CICS IA to discover which CICS applications use specific VSAM data; this is useful for testing.

Determining where VSAM data is used: The GENAPP application uses VSAM for various data stores, including the KSDSCUST file. You can use the CICS IA plug-in to the CICS Explorer to create a query to find all the programs that use the KSDSCUST file by transaction ID. The query result lists the programs and associated transactions that use the KSDSCUST file, and how each program accesses the file.

For the batch component of the application, scan the library that contains the Job Control Language (JCL) to identify the batch programs that use the KSDSCUST file.

VSAM to DB2 conversion: You can use the auto-mapping feature of CICS VT to convert the KSDSCUST VSAM file to a DB2 table with the appropriate structure. For complex data structures that require data manipulation, CICS VT provides exit facilities for field-level and record-level re-engineering. You can then use CICS VT and DB2 utilities to move the VSAM data to the new DB2 table.

Testing the conversion: To activate the run-time component of CICS VT in CICS, add appropriate definitions for the CICS VT run-time modules and DB2 definitions to CICS and activate CICS VT for the KSDSCUST table. For batch, change the Data Definition (DD) statements for the KSDSCUST file to point to the VT batch subsystem. When CICS transactions or batch jobs access KSDSCUST, CICS VT intercepts the VSAM request and issues an SQL call to access the new customer DB2 table.

Performance Considerations

IBM CICS Performance Analyzer (CICS PA) for z/OS is an offline historical performance analysis tool that provides detailed reports and views of CICS system and application performance.
Reports include transaction performance reports, reporting for trend analysis and capacity planning, and transaction profiling reports that compare new transaction activity with baseline data. The CICS PA reporting interface lets users tailor these reports and access the most relevant data without needing knowledge of specialized programming languages or the data layout. CICS PA also provides many sample alerts that simplify implementation of alert reporting.

When the GENAPP application runs in a CICSPlex environment, it’s slow when customer agents use the SSC1 transaction. You can use CICS PA to investigate the performance issue:

1. In the Transactions tab of the CICS Explorer, right-click the SSC1 transaction and select Performance history > Response time (see Figure 8). The resulting GENAPP response time chart shows unacceptably high average and peak response times.
2. Right-click a time interval on the chart and select Detail Breakdown. The resulting transaction detail chart shows that transactions spend most of the response time in suspend status.
3. Use the ISPF interface of CICS PA to run a CICS PA Wait Analysis report. The report in Figure 9 shows that terminal input wait and first dispatch time wait are significant parts of the time in suspend status. A reason for high terminal input wait might be that transaction SSC1 isn’t pseudo-conversational and a program needs correction. You can use the CICS IA command flow to identify the program (in this example, LGTESTC1).
4. Use CICS PA Transaction Profiling reports to measure the impact on response time for transaction SSC1 after correcting the program.
5. To identify high first dispatch time waits, view the CICS PA statistics alerts. These waits are caused when the SSC1 transaction runs too slowly and causes backups in the transaction class it runs in (DFHTCL09). CICS PA issues alerts when the statistic exceeds its critical threshold limit (see Figure 10).

You can use CICS PA together with real-time monitors. Use a real-time monitor with alerts active and CICS PA with alerts set to a lower threshold so performance trends are identified before they cause a problem and before the real-time monitor issues an alert.


This article is a shortened version of the IBM Redpaper REDP-4824-00, “Implementation of Popular Business Solutions with CICS Tools,” by Chris Rayns, Eric Higgins, and Peter Siddell.