CICS is the power of mainframe. It has all the capabilities to handle online transactions. The ppt covers highly useful CICS concepts to refresh your CICS knowledge quickly.
2. COURSE OBJECTIVES
After completing this course you should be able to
Appreciate the salient features of CICS as a
Transaction Processing system and as a DB/DC
System
Create user interfaces using CICS Basic Mapping
Support (BMS).
Access and modify VSAM files, database tables.
Handle normal and abnormal CICS exception
conditions.
Use advanced features of CICS: Data Tables,
Intercommunication, etc.
3. SESSIONS OUTLINE
CICS – Overview
CICS - Application Programming Considerations
CICS - Screen Handling - Basic Mapping Support
CICS - Error and Exception Handling
CICS - File and Database Handling
CICS - Program Control
CICS - Queuing Facility
CICS - Interval &Task Control
CICS - Testing and Debugging
4. SESSIONS OUTLINE – ADVANCED
TOPICS
CICS - Storage Control
CICS - CICS Intercommunication
CICS - Restart and Recovery
CICS - Administration and Set-up
DB2-CICS - Case Study
6. SESSION 1 : OBJECTIVES
To Understand the
Business requirements for an online transaction processing
environment
Features and Strengths of CICS
CICS Interface and Languages available to access CICS
CICS Concepts and Terminologies
Transaction Flow
7. Batch System Online System
Batch System
Online
System
Transaction file
MASTER FILE
REPORTS
VSAM / DATABASE
Terminals
BATCH AND ONLINE SYSTEM
8. AN ONLINE SYSTEM
ONLINE processing allows a user to interact with a
computer and access its resources via a terminal
Example : Railway Reservation system
Sales Processing system
Costing system
Stock Clearing System
9. WHAT IS CICS ?
Stands for Custo m e r Info rm atio n Co ntro lSyste mCusto m e r Info rm atio n Co ntro lSyste m
A world-class transaction processing system - by IBM
in 1960s
Availability
• Four versions in OS/390, CICS Transaction server 2.1 in z/OS
• AS/400, RISC/6000 & OS/2
• PC Servers
Provides an interface between application programs
and operating system services, such as data access
and communication access
11. CICS CONCEPTS
CICS runs as a batch job and can handle hundreds of interactive users
that are using a variety of applications
More than one CICS system (or re g io n) can run on the same computer
at the same time.
Programs running in one region do not interfere with programs running
in another region
12. TRANSACTIONS AND TASKSCICS locates a application program using a four character
code called Transactio n-ide ntifie r
Application programs are associated with a transaction which
when invoked starts a Task
A task is the execution of an application program for a
specific user
Several users may invoke the same transaction, with each
given a separate task
13. Transactions and Tasks
TASK 1 TASK 2
TXNA TXNA
working
storage for
task 1
working
storage for
task 2
TASK 1 started at terminal1 by user1
executes TXNA.
TASK 2 started at terminal2 by user2
executes the same TXNA.
These two tasks use the same load
module associated with TXNA.
However, the working storage for
each task is different.
14. FEATURES AND STRENGTHS OF
CICS
Multitasking within a single address space provided by the
Operating System
Multithreading allowing one copy of program loaded and
shared by all users
Reentrancy of programs providing separate copy of working
storage for each Task
Quasi-re-entrant
Priority handling
15. CICS – USER INTERFACESMajority of CICS applications written for 3270 display
terminals or PCs that are emulating 3270 terminals
Pre se ntatio n and Busine ss lo g ic pro vide d by CICS
the use r inte rface is im ple m e nte d using Basic Mapping Suppo rt (BMS)
CICS can also be used with other types of user
interfaces
CICS at the back-end provides business logic
Front end provides presentation logic
AVBpro g ram
Afro nt-e nd pro g ram writte n in a no the r platfo rm
We b applicatio ns run in a We b bro wse r thro ug h HTTP
16. CICS PROGRAMMING
LANGUAGESCOBOL
Most used in mainframe
Assembler language
Fairly popular till 1970s
PL/I
Alternative to COBOL in 1970s & 1980s
C and C++
Object oriented classes can be developed that access CICS services
Java
Newest language for writing CICS applications
Object oriented classes can be developed that access CICS services
17. System services
Monitoring functions
Application program
services
CICS SYSTEM
Operating System ( MVS/ESA)
Database
Access
Method (DL/I,
DB2)
Data
Access
(VSAM/
BDAM )
Telecommunication
Access method
(VTAM,TCAM,BTAM)
CICS/MV
S
Data
handling
functions
Data
Storage Data
communication
functions
CICS APP PROGRAMS (Cobol, PL/I, Assembler)
Terminal
Other systems
18. CICS - TERMS AND DEFINITIONS
Logical Unit of Work (LUW)
Synchronization Point (Syncpoint)
Basic Mapping Support
Transaction Types
19. LOGICAL UNIT OF WORK (LUW)
From the application designer's point of view, a LUW is
a
sequence of actions that needs to be completed before
any of
the individual actions can be regarded as complete as
shown
below
- - - - - - - - - - - - - - - LUW - - - - - - - - - - - - - - -
Task A |----------------|---------------------|---------------------------¦
SOT Update Delete EOT
File - 1 2 records (SP)
20. SYNCHRONIZATION POINT
(SYNCHPOINT)
CICS automatically issues a SYNCPOINT at the end
of each task
All the updates made by the task so far will be
committed
All the resources maintained by the dynamic log will
be released
21. BMS
Interface between the application program and the terminal
control (3270 devices)
Consists of supplied BMS modules and user-defined screen
maps
Provides format independence which simplifies positioning of
data on terminal
Uses maps as requested by the application program to
control the formatting of terminal I/O data
Maps created using the online tool SDF/CICS
23. TRANSACTION TYPES
Conversational Program
Program (transaction) remains idle when waiting for
user response
Program, data areas, control blocks remain in main
storage resulting in high virtual storage utilization
Pseudo-conversational Program
Program ends after it sends data to a terminal
Program is in storage only when processing data,
otherwise storage released for other
transactions/tasks.
29. CICS- CONTROL PROGRAMS AND
TABLES
(IBM SUPPLIED)
CICS
File
Contro
l
(FCP) Progra
m
Control
(PCP)
Task
Contro
l
(KCP)
Journal
Contro
l
(JCP)
Terminal
Control
(TCP)
Transien
t
Data
(TDP)
Temporar
y
Storage
(TSP)
Storag
e
Contro
l
(SCP)
30. CICS CONTROL PROGRAMS & TABLES
(USER SPECIFIED)
Terminal Control Program - TCT
Task Control Program - PCT
Program Control Program - PPT
File Control Program - FCT
Resource Control Program - RCT
Journal control Program - JCT
Temporary Storage Program - TST
Transient Data Program - DCT
Storage Control Program - SCT
31. TERMINAL CONTROL FLOW (TCT)
The Terminal Control
Table (TCT) has an entry
for each terminal
Together with Basic
Mapping Support, terminal
control provides an
application program, the
ability to communicate
with a terminal
32. TASK CONTROL (PCT)
Task control validates
transactions by checking the
ProgramControl Table (PCT)
Task is created after the
transaction is validated
Concurrent processing of more
than 1 task is possible
(multitasking)
Error message is sent to the
terminal by task control for an
invalid transaction
33. PROGRAM CONTROL (PPT)
Task Control passes control to
Program Control, which keeps
track of the location of every
application program
The Processing ProgramTable
(PPT) contains the program
size, program source language,
and other program information
Stores the program library
address the first time to make
subsequent loading of program
faster
34. USER APPLICATION PROGRAMS
The application program processes the input
and issues commands to request services
that are needed in performing the function of
the application
35. FILE CONTROL AND DATABASE
The application program issues
a command to retrieve a record
from a VSAM file
VSAM/(B)DAM are the only files
used in CICS and they should
be defined in the File Control
Table (FCT)
For access to relational
database as DB2, define the
attachment to DB2 in the
Resource Control Table (RCT)
36. JOURNAL CONTROL
The Journal control facility
automatically logs the changes
on the system log, when an
application changes record in a
file
System log defined in the
Journal Control Table (JCT)
enables CICS to back-out
changes when a task fails
Maximum of 99 journals
37. TRACE CONTROL
Tracing is a CICS debugging
aid
CICS can write trace entries in
a Trace Table (TRT)
Execute Diagnostic Facility
(EDF) is another feature that
enables interactive debugging
Command Interpreter (CECI)
allows a programmer to enter
and test CICS commands at the
terminal directly
38. DUMP CONTROL
In case of serious error
conditions, CICS will
abend the task with a task
dump
The CICS transaction
ABEND message
contains the ABEND
code.
39. TEMPORARY STORAGE CONTROL
Controls storage of data in main
storage or on disk for later
retrieval
Records can be retrieved in the
same sequence in which they
are stored
Records reside in Temporary
Storage Queue (TSQ) unless
deleted or when CICS closes
Temporary Storage Table
(TST) is required for recovery
purpose
40. TRANSIENT DATA CONTROL
CICS queuing function –
sequential queue
The Destination Control
Table (DCT) contains the
queue definitions
Transient data has 2 types
of queue:
Intra-partition transient data
Extra-partition transient data
41. ENDING THE TRANSACTION
Output of a CICS process
Program extracts necessary fields from the VSAM record and setup an output area to
be sent to the terminal
Task ends when the application program issues the
RETURN command
All storage associated will be released
Other tasks can use the storage just released
42. STARTING A TASK
TXN1 Trans. Program
TXC1 MAPPGC1
TXC2 MAPPGC2
TXN1 TXNPGM1TXN1 TXNPGM1
TXN2 TXNPGM2
PCT
Program. Location
MAPPGC1 In Storage
MAPPGC2 On Disk
TXNPGM1 In StorageTXNPGM1 In Storage
TXNPGM2 On Disk
PPT
Load Module Library
MAPPGC1 MAPLIB
MAPPGC2 MAPLIB
TXNPGM1 PGMLIBTXNPGM1 PGMLIB
TXNPGM2 PGMLIB
CICS Address Space
TXNPGM1
MAPPGC1
44. SESSION 1: SUMMARY
• Overview of Online transaction processing environment
• CICS Terms and Definitions
•Transaction, task, LUW, conversational and
pseudo-conversational style
• CICS control programs and control tables
•CICS System Responsibilities
45. REFERENCES
Yukihisa Kageyama, CICS Handbook, McGraw Hill Book Co.
CICS/ESA Application Programming Guide, Ver.3, Release
2.1.
CICS/ESA Intercommunication Guide
Joseph Le Bert, CICS Made Easy, McGraw Hill International
Editions, 1987
Raul Menendez and Doug Lowe, CICS for the COBOL
Programmer, Part 1&2, Mike Murach & Associates, 1992
Editor's Notes
Notes:
In this course we will discuss about the salient features of CICS as a Transaction Processing System. We will also see most of the commonly used CICS commands and functions. This knowledge will give you a sound frame work for initial program development and a logical starting point for more advanced work.
Notes:
This slide covers the topics that will be covered in this course
Notes:
Focus is on the way CICS is used on IBM mainframes.
CICS is a powerful teleprocessing system designed to control information in an online environment. It provides the environment necessary for development and execution of on-line applications thereby freeing the application developer from the dependencies of the Operating System, Hardware, etc.
Is an operating system in itself.
CICS is available as following :
CICS/ESA on IBM Mainframe running MVS
CICS/400 on AS/400 running OS/400
CICS/6000 on RISC/6000 systems running AIX
CICS/OS2 on PS/2 systems running OS/2
Notes:
CICS is a subsystem executing under the MVS address space. It acts as an interface between the application programs and the operating system and other system components such as the DB2 database subsystem.
CICS provides the required command interfaces for an application program with the Operating System, Database system and for Communication requirements.
Notes:
Services Provided - Data Communication, Data handling, Program Services, System Services, Monitoring
As each region runs in its own address space, programs running in one region won't interfere with programs running in another region.
Notes:
Transaction:
A unit of work that is done as an atomic operation - that is, the operation succeeds or fails as a whole.
In CICS, a transaction is identified by a 4 character ID, for e.g. TXN1 and is initiated, usually, by typing the transaction id in the top left hand corner of a screen.
Task:
An instance of the execution of a particular transaction type is a task. That is, one execution of a transaction, with a particular set of data, usually on behalf of a particular user at a particular terminal.
It is a control block, allocated in CICS storage, that contains all the information to run the CICS application program associated with a transaction
Notes:
Conversation:
In a typical online system, data is entered by the terminal user/operator. By pressing a terminal key, a transaction is triggered. Subsequent to the processing, the results are sent back to the terminal based on which the user responds by keying in additional data. This results in a sort of “conversation” between the terminal user and the transaction.
The difference between a task and transaction is shown above. Visualize a Library Information System. To add a new book, a record is to be added into the book-master database. Normally a transaction will be used for performing this operation. It is possible that several users may work at several terminals at the same time and add different book records to the master. All these users will use the same transaction, but CICS initiates a different task for each one of them.
Note
Features of CICS:
Multi-tasking - Ability to control many tasks running concurrently in an address space.
CICS provides for concurrent execution of multiple tasks, including tasks of the same type, like Order Entry. CICS has its own task management capabilities for execution of tasks within a single region partition and does not use the multitasking feature of the O/S.
Multi-threading - Ability to use only one copy of the program when more than one task of the same type is active thereby minimizing main storage.
Each task will acquire a working storage section; however all the tasks will use the same load module. This feature is called multi-threading. Since several tasks can be running at the same time, CICS is a multi-tasking system.
Once the program finishes executing, the working storage for that user is released and the virtual memory that was used is free to be allocated to another user.
Re-entrant – The ability of the program to enter itself without any modifications. This feature is called as Quasi-reentrant in CICS. The word ‘Quasi’ is added to differentiate it from OS.
The 3270 terminal is a character based terminal displaying 24 lines 80 characters each.
In order to display the data contents on a 3270 terminal, the terminal must receive the information in a series of data stream. For the 3270 family of devices, this stream is known as the 3270 data stream. The data stream is a mixture of control characters known as BCC and text data.
To relieve the task of building and decoding complicated strings of control characters and data, and to remove device dependant codes from the application programs, CICS provides a facility known as the Basic Mapping Support (BMS).
BMS is an interface between the application program and the terminal control. BMS allows to create a Map that specifies the format of data as it appears on the terminal device.
You can use 3270 terminals or 3270 emulation, the CICS application provides both the presentation logic and the business logic. In this case, the user interface is text only, not graphical. Also, all of the processing is done by the CICS application because 3270 terminals are “dumb” terminals, which means they can't do any processing.
Front-end program (VB) with GUI :
A front-end program written in another platform by issuing message requests through and IBM product called MQSeries
Logical Unit of Work (LUW):
A LUW is a collection of updating activity that is treated as a single unit.
In other words, the period between the start of a particular set of changes and the point at which they are completed is called a logical unit of work (LUW). The LUW is a fundamental concept of CICS recovery.
SOT – start of task
EOT – end of task
From the application designer's point of view, an LUW is a sequence of actions that needs to be completed before any of the individual actions can be regarded as complete as shown above.
Synchronization Point :
The end of a logical unit of work is indicated to CICS by a synchronization point (abbreviated to syncpoint).
A syncpoint arises in the following ways :
Implicitly at the end of a transaction, by an EXEC CICS RETURN command at the highest logical level.
Explicitly by EXEC CICS SYNCPOINT commands issued (to commit the changes made to the resources such as files, database tables etc.) by the application programmer at appropriate points in the transaction.
Every time a “EXEC CICS SYNCPOINT” command is issued,
the existing LUW is completed and
A new LUW is started.
BMS allows to create a Map that specifies the format of data as it appears on the terminal device.
Terminal control provides the interface between CICS and the operating system's telecommunication access method. It lets you send text or receive text from the terminal that initiated the task.
The most common telecommunication access methods are VTAM (the Virtual Telecommunication Access Method), SNA (Systems Network Architecture), and TCP/IP (Transmission Control Protocol/Internet Protocol). Some of these access methods can also be used in combination with each other.
Basic mapping support (BMS) provides the interface between application programs and terminal control. It lets you create maps that specify the position and the characteristics of the individual display elements on the terminal screen. As a result, you can create interfaces that are easy for users to work with.
Each terminal in the CICS system must be defined in the Terminal Control Table (TCT). Each terminal in this table is assigned a unique one- to four-character terminal identifier, or term-id.
To access CICS services from an application program, you use the CICS Application Programming Interface, or API.
An application program communicates with the API, which in turn communicates with the individual CICS services. In this way, the API insures that all of the CICS services are invoked in a consistent manner.
Transactions, and thus programs, can be classified as:
Conversational Program
Pseudoconversational Program
Conversational Program:
In a conversational program, after processing the data, the same will be sent to the terminal and the program will be in a “wait” state for the terminal user to complete further data entry.
Only when the terminal user completes the data entry and/or presses the Enter/PA keys, will the transaction re-start.
Till such time, the resources allocated to the task will have to be retained by CICS. A few such tasks will result in CICS going short of main storage allocated to it, thus affecting overall system performance.
Pseudoconversation
Once a task is initiated, CICS will keep processing it till an I/O or external input is required. It then suspends that task and releases its resources. When the I/O is complete, CICS will then resume the task. This is called pseudo-conversation.
Pseudoconversational programs are more efficient than Conversational programs but involve a bit of programming.
CICS restarts the program when the user completes an entry and presses one of the terminal's attention identifier (AID) keys.
The above three CICS commands1 are defined here to illustrate the concept of Conversational & Pseudo conversational programs.
EXEC CICS SEND MAP sends a stream of data as defined in the map map_name to the terminal screen from the data_area.
EXEC CICS RECEIVE MAP receives a stream of data from the terminal screen into the data_area as defined by the map map_name.
EXEC CICS RETURN transfers control from the application program to CICS. Optionally a transaction id - txn_name can be specified to CICS to start the transaction next time a terminal action such as pressing of Enter, PA keys occurs.
Notes:
This visual lists some of the CICS control Programs and Tables associated with them.
Terminal Control Program / Terminal Control Table (TCT): Has an entry for each terminal. Together with BMS support, terminal control provides an application program, the ability to communicate with a terminal.
Task Control Program / Program Control Table (PCT): Controls the flow of Tasks. All CICS transactions should be registered in the PCT. The relation between the txn id and the entry program should be defined here.
Program Control Program /Processing Program Table (PPT): Manages flow of CICS application program. All the CICS application programs & Maps should be registered in PPT.
File Control Program / File Control Table (FCT): Manages all the I/O operations of files under CICS. All the files used by the application program should be registered in FCT. Only VSAM/BDAM can be used in CICS.
Resource Control Program / Resource Control Table (RCT): Define attachments (txn id and plan name) to DB2 in this table.
Journal Control Program / Journal Control Table (JCT): Performs logging of data onto external files called Journals. System log file and other user journal files should be registered in JCT.
Temporary Storage Program / Temporary Storage Table (TST): Manages I/O operations on a Temporary Storage Queue (TSQ) .
Transient Data Program / Destination Control Table (DCT): Manages I/O operations of a transient Data Queue (TDQ)
Storage Control Program: It manages request of dynamic storage by the
CICS control program and application programs.
TCT -Terminal control accepts this input message from VTAM into a terminal input/output area (TIOA).
PCT - All transactions are defined in an in-storage table, Program Control Table (PCT).
PPT - The Processing Program Table also contains a program's location in storage when
loaded. Generally, there is only one copy of a program in storage, and many end
users can be executing it simultaneously.
So far, CICS has read the
input (INQY and account number) into a terminal I/O area, validated the transaction
identifier, and initiated a task.
If specified on the trace options, each CICS command that is called by the application
program, causes entries to be written to the trace table.
EDF - In this case, you can stop the flow of the program at specified points, examine data areas, and if necessary,
alter them. The program can be closely monitored, and the errors can be eliminated
online.
The transient data program stores records in the order that the program writes them,
in a sequential queue for each defined queue, called a Transient Data destination.
Transient data has two types of queue:
1. One may be written and read purely internally within a CICS region and is called Intra-partition Transient Data.
2. The other, called Extra-partition Transient Data, provides the sequential file access method (SAM) within CICS and can be written and read by CICS and non-CICS programs.
For example, a file on tape or on disk accessed by tasks CICS, can subsequently be read by a batch program and vice versa.
Notes:
When a transaction is initiated in a terminal, CICS looks for the transaction-id in the PCT.
If found, CICS gets the transaction details like program-id, security aspects, etc., associated with the transaction.
CICS then checks whether the program-id is defined in the PPT. If not, it generates an error and abends the transaction.
If the program is defined in the PPT, CICS then allocates working storage for this transaction using the Storage Control Program. It then transfers control to the application program.
If the program is already resident in main memory, CICS uses the same but with a separate working storage for this transaction. Otherwise, it is loaded into main memory.
System programmers debug CICS system problems and write CICS user exit and error management programs.
IT management and business executives view CICS as an indispensable middleware productivity tool that is essential in their transaction processing environment.
Application programmers use an extensive application programming interface (API) to write programs to process user requests.
Operators (Administrator) manage CICS jobs, abends, shutdowns and restarts.
Terminal users enter CICS transaction to run online applications.
Notes:
It is essential to know the difference between a transaction and a task and it may be worth reviewing this topic.