Implementing a CICS Interdependency Analyzer call tree generator

CICS Interdependency Analyzer is an IBM-provided tool for CICS Transaction Server that helps you understand the interrelationships between shared applications and services. This article shows you how to use REXX programming to create a call tree diagram that provides a clear picture of program call relationships.

Share:

Kai Cai (caikai@cn.ibm.com), Advisory Software Engineer, IBM China

Photo of Kai CaiKai Cai is a Advisory Software Engineer at the IBM China Software Development Laboratory. He has a Masters degree in Computer Science master has 14 years of experience in design, implementation, and support for IBM software products on z/OS. His focus areas include CICS Transaction Server, CICS Transaction Gateway, WebSphere MQ, and Java and C/C++ programming. You can contact Kai at caikai@cn.ibm.com.



Dongsheng Zhou (dshzhou@cn.ibm.com), Staff Software Engineer , IBM

Photo of  Dongsheng ZhouDongsheng Zhou is a Staff Software Engineer at the IBM China Software Development Laboratory. He has a Masters degree in Computer Science master has five years of experience in design, implementation, and support for IBM software products on z/OS. His focus areas include CICS Transaction Server, CICS Transaction Gateway, and C/C++ and COBOL programming. You can contact Dongsheng at dshzhou@cn.ibm.com.



Sangsoo Han (sangsooh@cn.ibm.com), CICS Business Development Manager, IBM China

Sangsoo Han is a CICS Business Development Manager for IBM China. He has 15 years experience with IBM mainframes, and his areas of expertise include CICS performance tuning, CICS tools, and z/OS PD tools such as CICS IA, CICS PA, and APA. You can contact Sangsoo at sangsooh@cn.ibm.com.



27 February 2013

Introduction

IBM® CICS® Transaction Server (CICS TS) is an advanced mainframe transaction processing platform for the z/OS platform, providing enterprise-scale, mission-critical transaction processing with high availability and scalability, and very low cost per transaction. CICS Interdependency Analyzer (CICS IA) is an IBM-provided tool for CICS TS that helps you understand the interrelationships between the shared resources of applications and services.

Many large organizations have been using CICS for decades, their CICS systems growing and evolving with their businesses. Typically, they have used a variety of techniques to implement new applications and functions to respond to new business requirements, technical capabilities, and corporate standards. Frequently, this growth has been somewhat unstructured, with many applications and services sharing common resources, and changes in one area affecting many other areas. Unstructured growth can reach a point where controlled development is no longer feasible until you develop a full understanding of these interrelationships. CICS IA can help you achieve this understanding.

The Collector component of CICS IA collects the dependencies that apply to a single CICS region -- that is, a single application-owning region (AOR), or a single, combined routing region and AOR. You can run the Collector component against both production CICS regions and test environments, to monitor possible dependencies introduced by new or changed application suites or packages. From the interactive interface of CICS IA, you can control Collectors running on multiple regions.

CICS IA collects these dependencies into a database, and dependency information from several CICS regions can be stored in the same database. You can review the collected dependencies using the CICS IA Query interface, or list them using the CICS IA Reporter.

This article shows you how to use REXX programming to create a call tree diagram that contains a clear picture of program call relationships.

CICS IA components

CICS IA has three main purposes:

  • To identify resources used by individual CICS transactions, and their relationships to other resources. CICS IA enables you to understand the characteristics of your application set, including:
    • What a CICS region contains
    • Which resources a transaction needs to be able to run
    • Which programs use which resources
    • Which resources are no longer used
  • To collect and analyze data about transaction affinities, which require particular groups of transactions to be run either in the same CICS region, or in a particular region.
  • To identify and analyze resource usage flow within a transaction or transactions, using the command flow feature. It enables individual users to capture all CICS, DB2, IMS, and WebSphere MQ commands in chronological order. This data is stored in DB2 tables, and each individual user can populate these tables with their own data. The CICS IA plug-in for CICS Explorer provides a new view to list all the command flow captures sorted by user ID.

CICS IA dependency-related components

CICS IA includes a number of collecting and reporting components. The two diagrams below show the collector structure and reporting structure of CICS IA components:

Figure 1. Collector structure of CICS IA components
Collector structure of CICS IA components
Figure 2. Reporting structure of CICS IA components
Reporting structure of CICS IA components

CICS IA command flow

The CICS IA command flow utility lets individual users capture CICS, DB2, IMS, and WebSphere MQ commands in chronological order for one or more transactions. With the command flow feature, you can trace the command flow in up to five transactions in chronological order. A trace name can be associated with each trace.

CICS IA uses a number of CICS Global User Exits (GLUEs) and a CICS Task Related User Exit (TRUE) to intercept commands. The command records are written to a CICS User Journal, which uses the MVS logger subsystem to write them to a log streams data set. At the end of a trace, a record containing the name, start time, end time, and the five possible transactions is written to the journal.

The data is read from the log stream data sets into a generation data set. The data in the generation data set is formatted to update the CIU_CMDFLOW_DATA and CIU_CMDFLOW_INDEX DB2 tables, or to create QSAM data sets with the data stored in the Comma Separated Value (CSV) format.

CICS IA command flow components

CICS IA includes a number of collecting and reporting command flow components:

Command flow collector
Collects all CICS, DB2, IMS, and WebSphere MQ commands in chronological order and writes them to the CICS Journal log stream.
Command flow database objects
Contains data extracted from the CICS Journal log stream created by the Collector. It is updated periodically to add data from new or infrequently run applications.
CICS IA plug-in for CICS Explorer
Provides a graphical front end to CICS IA.

This diagram shows the command flow option structure:

Figure 3. Command flow option structure
Command flow option structure

Design of CICS IA call tree generator

The CICS IA command flow call tree generator extracts the necessary information from the CSV file that the command flow created to store the command records. The program call tree diagram provides more detailed information on program call relationships from the command records in the CSV file. This diagram shows different ways to deploy CICS TG:

Figure 4. CICS IA program call tree generator structure
CICS IA program call tree generator structure

Input file of CICS IA program call tree generator

The CICS IA program call tree generator is the second development of command records from the CICS command flow. It creates a program call tree flow diagram for the programs based in one CICS task in order to clarify program relationships. The input file for the CICS IA program call tree is the CSV file generated by the CICS IA command flow.

Output file of CICS IA program call tree generator

The output file of the CICS IA command flow program call tree generator is a member in a PDS file that contains a program call tree diagram. Each program call tree diagram represents the program relationship in one CICS task. The input CSV file can contain command records from several CICS tasks, so the CICS IA command flow program call tree can have many output tree diagrams. This diagram shows the format of an output call tree diagram:

XXXXXXX XXXXXXX                
XXXXXXX XXXXXXX                
XXXXXXX XXXXXXX                
        XXXXXXX XXXXXXX        
        XXXXXXX XXXXXXX        
        XXXXXXX XXXXXXX        
        XXXXXXX XXXXXXX        
        XXXXXXX XXXXXXX        
        XXXXXXX XXXXXXX        
                XXXXXXX XXXXXXX
                XXXXXXX XXXXXXX
                        XXXXXXX
                        XXXXXXX

Implementation of CICS IA call tree generator

The table below uses the CSV file contents to explain the implementation of call tree generator. Normally one CSV file includes information from multiple tasks, recorded in sequence. For purposes of simplification, this article shows the analysis for only one task.

Example of CICS IA command flow record CSV file
Transaction
Name
Task namePROGRAM
(CALLER Name)
Function typeFunction IDRESOURCE_NAME
(CALLEE Name)
TRANSATASKAPROG1CALLPROGRAMPROG2
TRANSATASKAPROG1CALLPROGRAMPROG3
TRANSATASKAPROG3CALLPROGRAMPROG2
TRANSATASKAPROG3CALLPROGRAMPROG2
TRANSATASKAPROG3CALLPROGRAMPROG2
TRANSATASKAPROG3CALLPROGRAMPROG2
TRANSATASKAPROG3CALLPROGRAMPROG4
TRANSATASKAPROG4CALLPROGRAMPROG2
TRANSATASKAPROG4CALLPROGRAMPROG5
TRANSATASKAPROG5CALLPROGRAMPROG6
TRANSATASKAPROG6CALLPROGRAMPROG7
TRANSATASKAPROG7CALLPROGRAMPROG8
TRANSATASKAPROG5CALLPROGRAMPROG9

Filtering command records based on function type and function id

  • FUNCTION_TYPE = CALL and FUNCTION_ID = PROGRAM.
  • Mark the program name from PROGRAM field to CALLER program name.
  • Mark the program name from RESOURCE_NAME fields to CALLEE program name. See the table above for details.
Filter command records based on function type and function id
FUNCTION_TYPE = SUBSTR(RECORD_IN.I,215,4)  
FUNCTION_ID = SUBSTR(RECORD_IN.I,242,7) 
IF  (FUNCTION_TYPE = 'CALL') & (FUNCTION_ID = 'PROGRAM') THEN
DO  
CALLER_NAME.INDEX = SUBSTR(RECORD_IN.I,175,8) 
CALLEE_NAME.INDEX = SUBSTR(RECORD_IN.I,261,8) 
INDEX = INDEX + 1 
END

Case 1

If current CALLER program name is same as last CALLEE program name, then:

  • Current CALLER program level is same as last CALLEE program level.
  • Current CALLEE program level is same as last CALLEE program level plus 1.

Table 1 below shows Case 1. The last CALLEE program name and the current CALLER program name are both PROG3. According to Case1 analysis, the current CALLER program level is the same as the last CALLEE program level.

Table 1. Current CALLER program name is same as last CALLEE program name
Transaction NameTask NamePROGRAM (CALLER Name)Function TypeFunction IDRESOURCE_NAME (CALLEE Name)
TRANSATASKAPROG1CALLPROGRAMPROG2
TRANSATASKAPROG1CALLPROGRAMPROG3
TRANSATASKAPROG3CALLPROGRAMPROG2
Sample 1. Case 1 for CALLER program and CALLEE program
INDEX1 = INDEX - 1 
IF  (CALLER.INDEX = CALLEE.INDEX1) THEN
DO
CALLER_LEVEL.INDEX = CALLEE_LEVEL.INDEX1  
CALLEE_LEVEL.INDEX = CALLEE_LEVEL.INDEX1 + 1 
END

Case 2

If current CALLER program name is same as last CALLER program name, then:

  • Current CALLER program level is same as last CALLER program level.
  • Current CALLEE program level is same as last CALLEE program level.

Table 2 below shows Case 2. The last CALLER program name and the current CALLER program name are both PROG1. According to Case 2 analysis, the current CALLER program level is the same as the last CALLER program level.

Table 2. Current CALLER program name is same as last CALLER program name
Transaction NameTask NamePROGRAM (CALLER Name)Function TypeFunction IDRESOURCE_NAME (CALLEE Name)
TRANSATASKAPROG1CALLPROGRAMPROG2
TRANSATASKAPROG1 CALLPROGRAMPROG3
Sample 2. Case 2 for CALLER program and CALLEE program
INDEX1 = INDEX - 1
IF  (CALLER.INDEX = CALLER.INDEX1) THEN
DO  
CALLER_LEVEL.INDEX = CALLER_LEVEL.INDEX1
CALLEE_LEVEL.INDEX = CALLEE_LEVEL.INDEX1
END

Case 3

If current CALLER program name is same as any previous CALLER program name except the last one:

  • Current CALLER program level is same as previous CALLER program level.
  • Current CALLEE program level is same as previous CALLEE program level.

Table 3 below shows Case 3. The current CALLER program name and the previous CALLER program name are both PROG5. According to Case 3 analysis, the current CALLER program level is the same as the previous CALLER program level.

Table 3. Current CALLER program name is same as any previous CALLER program name
Transaction NameTask NamePROGRAM (CALLER Name)Function TypeFunction IDRESOURCE_NAME (CALLEE Name)
TRANSATASKAPROG5 CALLPROGRAMPROG6
TRANSATASKAPROG6CALLPROGRAMPROG7
TRANSATASKAPROG7CALLPROGRAMPROG8
TRANSATASKAPROG5 CALLPROGRAMPROG9
Sample 3. Case 3 for CALLER program and CALLEE program
INDEX2 = INDEX - 2
IF (INDEX2 > 1) THEN 
DO  INDEX3 = INDEX2 TO 1 BY -1
    IF (CALLER.INDEX = CALLER.INDEX3) THEN
    DO
    CALLER_LEVEL.INDEX = CALLER_LEVEL.INDEX3
    CALLEE_LEVEL.INDEX = CALLEE_LEVEL.INDEX3
    LEAVE 
    END
END

According to analysis for the three above cases, here is the final output:

Table 4. Final output
PROG1PROG2
PROG1PROG3
PROG3PROG2
PROG3PROG2
PROG3PROG2
PROG3PROG2
PROG3PROG4
PROG4PROG2
PROG4PROG5
PROG5PROG6
PROG6PROG7
PROG7PROG8
PROG5PROG9

Conclusion

This article described showed you how to design and implement the CICS IA program call tree generator. All of the information has been test and verified. This article uses REXX applications for the examples, but the principles are also valid for applications written in other languages such as COBOL and PL/I.

Resources

  • CICS resources
  • WebSphere resources
    • developerWorks WebSphere developer resources
      Technical information and resources for developers who use WebSphere products. developerWorks WebSphere provides product downloads, how-to information, support resources, and a free technical library of more than 2000 technical articles, tutorials, best practices, IBM Redbooks, and online product manuals.
    • developerWorks WebSphere application integration developer resources
      How-to articles, downloads, tutorials, education, product info, and other resources to help you build WebSphere application integration and business integration solutions.
    • Most popular WebSphere trial downloads
      No-charge trial downloads for key WebSphere products.
    • WebSphere forums
      Product-specific forums where you can get answers to your technical questions and share your expertise with other WebSphere users.
    • WebSphere on-demand demos
      Download and watch these self-running demos, and learn how WebSphere products and technologies can help your company respond to the rapidly changing and increasingly complex business environment.
    • WebSphere-related articles on developerWorks
      Over 3000 edited and categorized articles on WebSphere and related technologies by top practitioners and consultants inside and outside IBM. Search for what you need.
    • developerWorks WebSphere weekly newsletter
      The developerWorks newsletter gives you the latest articles and information only on those topics that interest you. In addition to WebSphere, you can select from Java, Linux, Open source, Rational, SOA, Web services, and other topics. Subscribe now and design your custom mailing.
    • WebSphere-related books from IBM Press
      Convenient online ordering through Barnes & Noble.
    • WebSphere-related events
      Conferences, trade shows, Webcasts, and other events around the world of interest to WebSphere developers.
  • developerWorks resources
    • Trial downloads for IBM software products
      No-charge trial downloads for selected IBM® DB2®, Lotus®, Rational®, Tivoli®, and WebSphere® products.
    • developerWorks business process management developer resources
      BPM how-to articles, downloads, tutorials, education, product info, and other resources to help you model, assemble, deploy, and manage business processes.
    • developerWorks blogs
      Join a conversation with developerWorks users and authors, and IBM editors and developers.
    • developerWorks tech briefings
      Free technical sessions by IBM experts to accelerate your learning curve and help you succeed in your most challenging software projects. Sessions range from one-hour virtual briefings to half-day and full-day live sessions in cities worldwide.
    • developerWorks podcasts
      Listen to interesting and offbeat interviews and discussions with software innovators.
    • developerWorks on Twitter
      Check out recent Twitter messages and URLs.
    • IBM Education Assistant
      A collection of multimedia educational modules that will help you better understand IBM software products and use them more effectively to meet your business requirements.

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=858968
ArticleTitle=Implementing a CICS Interdependency Analyzer call tree generator
publish-date=02272013