Cics Tutorial PDF
Cics Tutorial PDF
CICS
Audience
This tutorial is designed for software programmers who would like to understand
the concepts of CICS starting from scratch. This tutorial will give you enough
understanding on CICS from where you can take yourself to higher levels of
expertise.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of
COBOL programming. A basic knowledge of MVS and TSO/ISPF subsystem will
help you grasp the concepts of CICS better.
All the content and graphics published in this e-book are the property of Tutorials
Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy,
distribute, or republish any contents or a part of contents of this e-book in any
manner without written consent of the publisher. We strive to update the contents
of our website and tutorials as timely and as precisely as possible, however, the
contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides
no guarantee regarding the accuracy, timeliness, or completeness of our website
or its contents including this tutorial. If you discover any errors on our website or
in this tutorial, please notify us at [email protected]
i
CICS
Table of Contents
About the Tutorial .................................................................................................................................. i
Audience ................................................................................................................................................ i
Prerequisites .......................................................................................................................................... i
1. CICS – OVERVIEW............................................................................................................... 1
Transaction ............................................................................................................................................ 8
Task ....................................................................................................................................................... 8
LUW....................................................................................................................................................... 9
Application ............................................................................................................................................ 9
PCP ...................................................................................................................................................... 10
FCP ...................................................................................................................................................... 10
SCP ...................................................................................................................................................... 11
Transaction .......................................................................................................................................... 12
CESN .................................................................................................................................................... 16
CEDA ................................................................................................................................................... 16
CEMT ................................................................................................................................................... 16
CECI ..................................................................................................................................................... 17
CEDF .................................................................................................................................................... 18
CMAC .................................................................................................................................................. 18
CESF ..................................................................................................................................................... 18
CEBR .................................................................................................................................................... 18
7. CICS – BMS....................................................................................................................... 24
Mapset ................................................................................................................................................ 25
BMS Macros ........................................................................................................................................ 25
Attribute Byte...................................................................................................................................... 33
iv
CICS
Return-2 .............................................................................................................................................. 48
DFHAID ................................................................................................................................................ 49
Random Access.................................................................................................................................... 54
Read .................................................................................................................................................... 54
Read Command Options ..................................................................................................................... 56
Read Command Exceptions ................................................................................................................ 57
Write ................................................................................................................................................... 57
Write Command Exceptions ............................................................................................................... 58
Rewrite ................................................................................................................................................ 59
Rewrite Command Exceptions ............................................................................................................ 60
Delete .................................................................................................................................................. 60
Delete Command Exceptions .............................................................................................................. 62
STARTBR .............................................................................................................................................. 62
RESETBR .............................................................................................................................................. 63
ENDBR ................................................................................................................................................. 64
Abend .................................................................................................................................................. 67
v
CICS
Nohandle ............................................................................................................................................. 68
XCTL .................................................................................................................................................... 71
Link ...................................................................................................................................................... 72
Load .................................................................................................................................................... 72
Release ................................................................................................................................................ 73
Return ................................................................................................................................................. 73
COMMAREA ........................................................................................................................................ 75
WRITEQ TS ........................................................................................................................................... 76
READQ TS ............................................................................................................................................ 76
DELETEQ TS ......................................................................................................................................... 77
WRITEQ TD .......................................................................................................................................... 77
READQ TD ............................................................................................................................................ 77
DELETEQ TD ......................................................................................................................................... 78
vi
CICS
vii
CICS
1. CICS – OVERVIEW
CICS is a DB/DC system which is used in online applications. CICS was developed
because batch operating system can execute only batch programs. CICS programs
can be written in COBOL, C, C++, Java, etc. These days, users want information
within seconds and in real time. To provide such quick service, we need a system
which can process information online. CICS allows users to communicate with the
back-end system to get the desired information. Examples of online programs include
online banking system, flight reservation, etc. Following image shows the
components of CICS and how they are inter-related:
Functions of CICS
The main functions performed by CICS in an application are as follows:
Although, multiple users are working on CICS system but it gives a feel to user
that he is the single user only.
CICS gives the access to data files for reading or updating them in an
application.
8
CICS
Features of CICS
The features of CICS are as follows:
It is possible to have two or more CICS regions at the same time, as CICS runs
as a batch job in the operating system at the back-end.
9
2. CICS – ENVIRONMENT CICS
CICS itself acts as an operating system. Its job is to provide an environment for
online execution of application programs. CICS runs in one region or partition or
address space. CICS handles scheduling for programs running under it. CICS runs as
a batch job and we can view it in the spool by issuing the command PREFIX CICS*.
There are five major services which are provided by CICS. All these services together
perform a task.
CICS Environment
Following are the services which we will be discussing in detail step by step:
System Services
Monitoring Services
System Services
CICS releases application programs from the burden of dealing with terminal
hardware issues through the use of Basic Mapping Support (BMS).
CICS provides Multi Region Operation (MRO) through which more than one
CICS region in the same system can communicate.
CICS provides Inter System Communication (ISC) through which a CICS region
in a system can communicate with the CICS region on another system.
11
CICS
Monitoring Services
Monitoring Services monitor various events within CICS address space. It provides
series of statistical information that can be used for system tuning.
12
3. CICS – BASIC TERMS CICS
We must have knowledge of the basic terms used in CICS to get a better
understanding of how it works. Application programs use CICS for communication
with remote and local terminals and subsystems.
CRT Monitor
The CRT monitor displays the output or the input fields of the application program. A
screenshot of a 3278 Model of CRT monitor is shown below. It has the following
characteristics:
A COBOL application program can send data to all the positions on the screen.
13
CICS
Keyboard
IBM keyboard keys are divided into following two categories:
Non-AID Keys – All other keys for alphabets, numeric, punctuation etc. are
Non-Aid keys. When the user types text or numbers using non-aid keys, CICS
will not even know if the user is typing anything or not.
AID Keys – AID keys are known as Attention Identifier Keys. CICS can detect
only AID keys. After typing all the input, only when the user presses one of
the AID keys, CICS takes control. AID Keys : ENTER, PF1 to PF24, PA1 to PA3,
CLEAR. AID keys are further divided into two categories:
14
CICS
Transaction
A CICS program is invoked through a transaction. A CICS transaction is a collection
of logically related programs in an application. The whole application could be logically
divided into several transactions.
Transaction identifiers which are 1 to 4 characters long are used to identify the
transactions which the users want to do.
Task
A Task is a unit of work which is specific to a user.
A task can receive data from and send data to the terminal that started it. It
can read and write files and can start other tasks also.
15
CICS
LUW
LUW stands for Logical Unit of Work. LUW states that a piece of work should be done
completely or not done at all. A task can contain several Logical Unit of Works in
CICS. We will discuss more about it in upcoming modules.
Application
An application is a series of logically grouped programs to form several transactions
which is used to complete a specific task for the end-user.
16
4. CICS – NUCLEUS CICS
The five CICS system components described earlier are a convenient grouping of
CICS system programs, each of which performs its own specialized functions. The
core of CICS known as the CICS Nucleus which consists of IBM-supplied CICS Control
Programs and Control Tables.
Control Programs
CICS nucleus is constructed by the control programs and corresponding control
tables. It provides unique advantages. It makes the CICS system highly flexible and
thus easy to maintain. Following are the important control programs of CICS:
TCP
TCP is known as Terminal Control Program.
KCP
KCP is known as Task Control Program.
KCP is used to simultaneously control the execution of tasks and its related
properties.
PCP
PCP is known as Program Control Program.
It transfers the control between programs and in the end, it returns the control
back to the CICS.
17
CICS
FCP
FCP is known as File Control Program.
FCP is used to provide application programs with services like read, insert,
update or delete records in a file.
It keeps exclusive control over the records in order to maintain data integrity
during record updates.
SCP
SCP is known as Storage Control Program. It is used to control allocation and de-
allocation of storage within a CICS region.
Control Tables
CICS consists of IBM-supplied CICS control programs and tables. These tables need
to be updated accordingly with the application information for successful execution
of CICS application programs. Following are the important Control Tables:
TCT
TCT is known as Terminal Control Table.
TCT contains the terminal ID's that are connected to current CICS region.
Terminal Control Program along with terminal control table recognize the
incoming data from the terminal.
PCT
PCT is known as Program Control Table.
18
CICS
PPT
PPT is known as Processing Program Table. PPT contains Program name or Mapset
name, Task Use Counter, Language, Size, Main storage address, Load library address,
etc.
FCT
FCT is known as File Control Table.
All the files used in a CICS program must be declared in FCT and they are
opened and closed by CICS itself.
Transaction
When a transaction identifier TP02 is entered on the CICS terminal, first it checks if
there is a program associated with this Transaction identifier in the PCT table. If it
finds one, then it checks in the PPT table to find the location of the Program to execute
it.
If the program is already available in the memory, it starts executing that particular
program; if not, it loads the program to the memory from the secondary storage and
then starts executing it.
19
CICS
20
CICS
Step 1
The terminal operator initiates the transaction by typing a 1 to 4-character
transaction-id and pressing the ENTER key.
Step 2
The TCP periodically checks all the terminals for input. When a message is received,
it does the following:
21
CICS
22