Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 19

CICS

CICS
(Customer Information Control System)
CICS
Table of Contents
• Introduction to CICS
• Basic Mapping Support
• Program Control
• File Control
• Queues
• Interval and Task Control
• Recovery and restart
• Program preparation
• CICS Supplied Transactions
• Screen Definition Facility
CICS

Introduction to CICS
CICS

Introduction
• Customer Information Control System -CICS developed
in late 1960s as a DB/DC control system
• CICS provides an interface between the Operating
System and application programs
• Macro Level CICS - initial version Assembler macro to
request CICS services
• Command Level CICS - high level lang.version -
commands to request CICS services - Single command
can replace series of macros
CICS

Batch & Online : Differences


• BATCH SYSTEM • ONLINE SYSTEM
1. Input data is prepared and 1. Data is entered as needed
given in sequence (file) not in sequence (terminal)
2. Processing sequence is 2. Since processing seq. is
predictable and hence unpredictable, special
restarting the process in recovery/restart proc. is
case of failure is easy. reqd. in case of failure.
3. Programs and files can’t 3. Programs and files can
be shared be shared
4. Programs are scheduled 4. Transaction can be run at
through jobs any time
CICS

CICS & Operating System

Operating System

CICS
Enter Code :
User’s Files &
App.Prg Database
CICS

DB/DC System

Terminals
Data
Base
Central System
CICS

CICS System Services

• Data-Communication Functions
• Data-Handling Functions
• Application Program Services
• System Services
• Monitoring Functions
CICS

Task &Transaction
• Task :- A basic unit of work which is scheduled by the
operating system or CICS
Ex -Read from and write to the terminal

• Transaction :- An entity which initiates execution of a


task. In CICS, transaction is identified by the transaction
identifier (Trans-id)
CICS
Application Programming
Concepts

• Pseudo-Conversational

• Multitasking

• Multithreading

• Quasi-Reentrancy
CICS

Terminal Conversation
• Conversational : A mode of dialogue between program
and terminal based on a combination of sending message
and receiving message within the same task
• Since human response is slower than the CPU speed, a
significant amount of resource will be wasted just waiting

• Pseudo-Conversational. A mode of dialogue between


program and terminal which appears to the operator as a
continuous conversation but which is actually carried by a
series of tasks
CICS
Conversational Transaction
Example
PROCEDURE DIVISION.
:
FIRST-PROCESS.
EXEC CICS RECEIVE ---- <= TSK1,12345
END-EXEC.
: process
EXEC CICS SEND ----- <= EMP(12345) Details
END-EXEC.
* - - - - - - Program Waits For Response - - - - -
SECOND PROCESS.
EXEC CICS RECEIVE ----- <= User Enters Data
END-EXEC.
: process
CICS
Pseudo-Conversational
Example
Transaction TSK1 Transaction TSK2
Program PROG1 Program PROG2
PROCEDURE DIVISION. PROCEDURE DIVISION.
: :
EXEC CICS RECEIVE
EXEC CICS RECEIVE
END-EXEC.
END-EXEC.
:
:
EXEC CICS SEND
END-EXEC.
EXEC CICS SEND
EXEC CICS RETURN END-EXEC.
TRANSID (‘TSK2’) EXEC CICS RETURN
END-EXEC. END-EXEC.
CICS

CICS Components
• Control Programs (or Management Modules)
Programs that interface between OS and app. pgm
Handle the general functions that are crucial to operation of CICS
• Control Tables
Define the CICS environment
Functionally associated with the management module
• Control Blocks (or Areas)
Contain system type information. Eg. Task Control Area contains
information about the task
CICS
Management Pgms. & Ctrl.
Tables
• Programs • Tables
Program Control PCP Processing Progm Table PPT
File control FCP File Control Table FCT
Terminal Control TCP Terminal Control Table TCT
Task Control KCP Program Control Table PCT
Temporary Storage TSP Temp. Storage Table TST
Transient Data TDP Destin. Control Table DCT
Storage Control SCP
Interval Control ICP
Journal Control JCP
CICS

CICS Program Considerations


• Considerations

- Must eventually return control to CICS

- Can’t modify procedure division instructions ‘cause CICS


programs may be shared by many tasks

- Can modify working storage since a unique copy of working


storage is created for each task
CICS

CICS Program Restrictions


• Restrictions

- No CONFIG. SECTION, I/O SECTION to be specified in the


ENVIRONMENT DIVISION.

- FILE SECTION, OPEN, CLOSE, and non-CICS READ &


WRITE statements are not permitted because file management is
handled by CICS.

- COBOL commands such as ACCEPT, DISPLAY, EXHIBIT,


TRACE, STOP RUN, GOBACK are avoided. (STOP RUN &
GOBACK are sometimes included in order to eliminate compiler
diagnostic but never executed)
CICS

Sample CICS Program


IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-INPUT.
05 WS-TRANSID P IC X(4).
05 FILLER PIC X(1).
05 WS-IN-EMP-CD PIC X(4) VALUE ALL ‘X’.
01 WS-OUTPUT.
05 FILLER PIC X(16) VALUE ‘EMP CODE : ‘.
05 WS-OUT-EMP-CD PIC X(4).
01 WS-LENGTH PIC S9(4) COMP.
LINKAGE SECTION.
CICS

Sample Program Contd.


PROCEDURE DIVISION.
000-MAINLINE.
PERFORM 100-RECV-INPUT.
PERFORM 200-SEND-OUTPUT.
EXEC CICS RETURN END-EXEC.
STOP RUN.
100-RECV-INPUT.
MOVE 9 TO WS-LENGTH.
EXEC CICS RECEIVE
INTO (WS-INPUT) LENGTH (WS-LENGTH)
END-EXEC.
MOVE WS-IN-EMP-CODE TO WS-OUT-EMP-CODE
200-SEND-OUTPUT.
EXEC CICS SEND
FROM (WS-OUTPUT) LENGTH (20)
ERASE
END-EXEC.

You might also like