Vous êtes sur la page 1sur 41

Introduction to CICS

What is CICS? (Customer


Information Control System)
IBM definition: “CICS is a DB/DC control system”.

TERMINAL
VTAM
VSAM
BTAM CICS DASD
TCAM DB2

Application
Programs
Brief History of CICS
• Introduced by IBM in 1968 – ran only on IBM
mainframes
• CICS on many platforms
• Introduction of Transaction Server
Batch On-line
• Jobs are submitted for • Jobs submitted are
execution by the executed immediately
processor at later time • User interaction is an
• Absence of any usual thing
interaction from user • Program starts, process a
• Program starts, processes record and ends
all records and ends • Performance measure is
• Performance measure is response time
throughput • When CICS program
• When program ABENDS ABENDS it may bring
it just ends the program down the entire system
Features of CICS
• A Data Base/Data Communication (DB/DC)
control system
• Is a generalized transaction processing interface
• Provides on-line environment in batch OS
• Is an operating system in itself
• Runs as a batch job within the OS/390 OS
• Many languages can be used for developing
CICS programs – COBOL being the most
common
CICS Service Diagram
CICS OS/390
VSAM File Control
Application
DB2 SQL Application
Programming
Program
IMS DL/I Interface

Terminal
Basic
Control
Mapping Maps
Support

VTAM,SNA,TCP/IP)
(

Terminal User
Sample CICS Scenario
• Transaction ID Entered
• Looked up in PCT - Program loaded
• Program displays initial map and ends
• User enters data and hits ‘Enter’ key
• Program reloaded
– Receives data from screen
– Processes data
– Sends response back to screen
– Returns to CICS
CICS Program Invocation
CICS finds CICS finds
User Enters
TRANS-ID in PCT program name
TRANS-ID
to get program name in PPT

CICS loads program


CICS runs program
into memory/
in address space
starts program

TRANS-ID = Transaction Identifier


PCT = Program Control Table
PPT= Processing Program Table
Transaction
B021

PCT PPT

Transaction Programs Program Location

B011 PB011 PB011 In Storage


B021 PB021 PB021 On Disk
B031 PB013 PB031 In Storage

PB011
CICS Address Library Load Module

space PB011 PB011


PB021 PB031 PB031
PB021 PB021
What does CICS do?

• Telecommunication
• Multitasking
• Data access and transaction control
• Inter System communication
Some Basic Terminologies
• Task: Task is a unit of work specific to a user

• Transaction: A CICS program cannot be directly


invoked and is done through a transaction

• Difference between transaction and task is, although


several users can invoke a transaction, each user
initiates his own task
Some Basic Terminologies
Logical Unit of Work:
A piece of work, that should be done completely or
not done at all.
Application: Is a collection of programs that
accomplish some specific task for the end user
CICS Nucleus – Control Programs
1. TCP (Terminal Control Program)
2. KCP (Task Control Program)
3. PCP (Program Control Program)
4. FCP (File Control Program)
5. SCP (Storage Control Program)
and many more like TSP (Temporary
Storage Program) and SIP (System
Initialization Program)
CICS Nucleus – Control Tables
1. TCT (Terminal Control Table)
2. PCT (Program Control Table)
3. PPT (Processing Program Table)
4. FCT (File Control Table)
5. RCT(Resource Control Table)
6. And many more…
CICS Concepts
• Macro level
• Command level
• Multitasking
• Multithreading
• Quasi reentrancy
Map and Mapset
• Representation of one screen format is called Map (screen panel).

• One or more maps, link edited together, makes up a Mapset (load


module).

• Mapset must have a entry in PPT as given below:


DFHPPT TYPE=ENTRY,MAPSET=name
Or DFHPPT TYPE=ENTRY,PROGRAM=name
Types of MAPS
There are 2 types of MAPS
• Physical Map
Physical Map is a map used by CICS (CSECT)
Ensure device independence in the application program
BMS macro coding ==> Assembly==> Link edit ==> Load module ==>
LOADLIB ===> To be used by CICS
• Symbolic Map
Ensure device and format independence in the application program
Symbolic Map is a map used by Application Program (DSECT)
BMS macro coding ==> Assembly ==> Symbolic map definition ==>
COPYLIB ==> Copied (COPY) into CICS application program.
Physical Map

Physical Map.
• The BMS macros are assembled and link-edited into CICS load library
to create the physical map. The mapset like any other CICS program is
stored in CICS runtime library the PPT(Program Processing Table). At
the program execution time the physical map is being used by CICS to
load the screen image.

• In case of input operations, the physical map defines the maximum


length, the starting position for each field to be read and allows BMS to
interpret an input NMDS.

• In case of output operations, the physical map defines the starting


position, length, field characteristics and the default data for each field
and allows BMS to construct an output NMDS.
Symbolic Map

• The symbolic map is coded using the BMS macro, assembled separately
and catalogued into a copy library. The symbolic map serves as a DSECT
for referencing the Terminal Input/Output Area (TIOA). The program
issues a COBOL COPY statement to include it in the program.

• The symbolic maps represents the actual data structure of the fields
defined in the physical map, and is used by the application program to
send and receive information from the terminal, in the CICS SEND-MAP
& RECEIVE MAP commands.

• The symbolic map can be used by the CICS application programs to


dynamically to alter the field attributes, modify screen cursor position,
and highlight , protect , unprotect specific fields on the screen.
CICS Datasets
Local and Global Catalog Datasets
• There are two catalog datasets available in CICS
– Local catalog
– Global Catalog

• The CICS catalog data sets are not connected


with MVS system catalogs, and contain data that
is unique to CICS
Global Catalog

• The global catalog is a VSAM key-sequenced data set


(KSDS).
• Only one global catalog
• To record information that governs the possible types of
start and the location of the CICS system log.
• During the running of CICS, to hold the resource definitions
that are installed during initialization
• During the running of CICS, to hold the resource definitions
that are installed during initialization when CICS installs the
group list, by the RDO CEDA INSTALL command or by
the EXEC CICS CREATE command.
• During a normal (controlled) shutdown, to record terminal
control information and profiles.
Local catalog
• CICS Transaction Server for OS/390 is divided into
functional areas (or components) known as domains. These
domains communicate through a central component, the
CICS kernel, and their initialization and termination is
controlled by the domain manager. The kernel, the domain
manager, and the other domains all require an individual
domain parameter record, and these are stored in the local
catalog.
• Local catalog is VSAM KSDS
• It is not shared by any other CICS region, such as an
alternate CICS in an XRF environment.
• Before the local catalog can be used to bring up a CICS
region, it must be initialized.
• DFHCCUTL utility is used for initializing local catalog.
DUMP Datasets
• CICS uses for recording dumps as a consequence
of a failure detected during CICS execution.
• There are two dump datasets used
– CICS transaction dump data sets, for recording transaction dumps.
– MVS system dump data sets, for recording system dumps
• CICS produces a system dump using the MVS
SDUMP macro.
CICS Shutdown processing
• CICS can stop executing as a result of:
• A normal (warm) shutdown initiated by a CEMT, or
EXEC CICS, PERFORM SHUT command
• An immediate shutdown initiated by a CEMT, or
EXEC CICS, PERFORM SHUT IMMEDIATE
command
• An abnormal shutdown caused by a CICS system
module encountering an irrecoverable error
• An abnormal shutdown initiated by a request from
the operating system (arising, for example, from a
program check or system abend)
• A machine check or power failure
Stages of CICS Shutdown
• First Quiesce Stage
• During the first quiesce stage of shutdown, all
terminals are active, all CICS facilities are
available, and the following activities are performed
concurrently.
• CICS invokes the shutdown assist transaction
specified on the SDTRAN system initialization
parameter or on the shutdown command.
• The purpose of the shutdown assist transaction is to
allow as many tasks as possible to commit or back
out cleanly,while ensuring that shutdown completes
within a reasonable time.
CICS obtains the name of the shutdown
assist transaction as follows
• If SDTRAN(tranid) is specified on the PERFORM
SHUTDOWN command, or as a system
initialization parameter, CICS invokes that tranid.
• If NOSDTRAN is specified on the PERFORM
SHUTDOWN command, or as a system
initialization parameter, CICS does not start a
shutdown transaction
• If the SDTRAN (or NOSDTRAN) options are
omitted from the PERFORM SHUTDOWN
command, and omitted from the system
initialization parameters, CICS invokes the default
shutdown assist transaction, CESD,which runs the
CICS-supplied program DFHCESD
Second quiesce stage
• Terminals are not active.
• No new tasks are allowed to start.
• Programs listed in the second part of the
shutdown PLT (if any) run sequentially.
• These programs cannot communicate with
terminals, or make any request that would cause
a new task to start.
Third Quiesce Stage
• CICS closes all files that are defined to CICS file control. However,
CICS does not catalog the files as UNENABLED; they can then be
opened implicitly by the first reference after a subsequent CICS restart.
• All extrapartition TD queues are closed
• CICS writes statistics to the system management facility (SMF) data
set.
• CICS recovery manager sets the type-of-restart indicator in its domain
state record in the global catalog to “warm-start-possible”.
• CICS writes warm keypoint records to: The global catalog for terminal
control and profiles and The CICS system log for all other resources.
• CICS deletes all completed units of work (log tail deletion), leaving
only shunted units of work and the warm keypoint.
• CICS stops executing
Warm key point Record
• The CICS-provided warm keypoint program
(DFHWKP) writes a warm keypoint to the
global catalog, for terminal control and profile
resources only, during the third quiesce stage of
shutdown processing when all system activity is
quiesced.
• The warm keypoints contain information needed
to restore the CICS environment during a
subsequent warm or emergency restart.
Immediate Shutdown processing

• You initiate an immediate shutdown by a CEMT, or EXEC CICS,


PERFORM SHUTDOWN IMMEDIATE command.
• If the shutdown assist transaction is not run user tasks are not
guaranteed to complete
• None of the programs listed in the shutdown PLT is executed.
• CICS does not write a warm keypoint or a warm-start-possible
indicator to the global catalog.
• CICS does not close files managed by file control. It is left to
VSAM to close the files when VSAM is notified by MVS that the
address space is terminating.
• The next initialization of CICS must be an emergency restart, in
order to preserve data integrity. An emergency restart is ensured if
the next initialization of CICS specifies START=AUTO. This is
because the recovery manager’s type-of-restart indicator is set to
“emergency-restart-needed” during initialization and is not reset in
the event of an immediate or uncontrolled shutdown.
Uncontrolled termination
• An uncontrolled shutdown of CICS can be
caused by:
– Power failure
– Machine check
– Operating system failure

• CICS does not write a warm keypoint or a


warm-start-possible indicator to the global
catalog.
CICS Startups
• Warm Start
• Emergency Start
• Cold start
• Initial Start
Warm Start
• If you shut down a CICS region normally, CICS
restarts with a warm restart if you specify
START=AUTO.
• For a warm start to succeed, CICS needs the
information stored in the CICS catalogs at the
previous shutdown, and the information stored in
the system log.
• Restores the state of the CICS region to the state it
was in at completion of the normal shutdown. All
CICS resource definitions are restored from the
global catalog, and the GRPLIST, DCT, FCT, and
CSDxxxx system initialization parameters are
ignored.
• CICS also uses information from the warm keypoint
in the system log.
• Reconnects to the system log.
• Retries any backout-failed and commit-failed units
of work.
• Rebuilds indoubt-failed units of work.
Emergency Start
• If a CICS region fails, CICS restarts with an
emergency restart if you specify
START=AUTO.
• Most of CICS initialization following an
emergency restart is the same as for a warm
restart, and CICS uses the catalogs and the
system log to restore the state of the CICS region
Cold Start
• On a cold start, CICS reconstructs the state of the region
from the previous run for remote resources only.
• For all resources, the region is built from resource
definitions specified on the GRPLIST system
initialization parameter and those resources defined in
control tables.
• CICS preserves, in both the global catalog and the system
log, all the information relating to distributed units of
work
• Generally, to perform a cold start you specify
START=COLD, but CICS can also force a cold start in
some circumstances when START=AUTO
• CICS deletes all cataloged resource definitions in the
CICS catalogs and installs definitions either from the
CSD or from macro control tables. CICS writes a record
of each definition in the global catalog data set as each
resource definition is installed.
• CICS preserves the recovery manager control record,
which contains the CICS logname token used in the
previous run. CICS also preserves the log stream name of
the system log.
• CICS discards any information from the system log that
relates to local resources, and resets the system log to
begin writing at the start of the primary log stream.
Initial Start
• If you specify START=INITIAL, CICS performs an initial start as if
you are starting a new region for the first time. This initial start of a
CICS region is different from a CICS region that initializes with a
START=COLD parameter
• The state of the global catalog is ignored. It can contain either data
from a previous run of CICS, or it can be newly initialized. Any
previous data is purged.
• The state of the system log is ignored. It can contain either data from a
previous run of CICS, or it can reference new log streams. CICS does
not keep any information saved in the system log from a previous run.
• The primary and secondary system log streams are purged and CICS
begins writing a new system log.
• Because CICS is starting a new catalog, it uses a new logname token
• An initial start can also result from a START=COLD parameter if the
global catalog is newly initialized and does not contain a recovery
manager control record.
Native CICS Commands
CESN: CICS Execute Sign ON

CEDA: CICS Execute Definition and Administration

CEMT: CICS Execute Master Terminal

CECI: CICS Execute Command Interpreter

CEDF: CICS Execute Debug Facility


CMAC: CICS Messages for Abend Codes
CESF: CICS Execute Sign OfF
CEBR – CICS Execute temporary storage BRowse
Thank You!

Vous aimerez peut-être aussi