Documente Academic
Documente Profesional
Documente Cultură
Table of Contents
Introduction to CICS
Basic Mapping Support
Program Control
File Control
Queues
Program preparation
CICS Supplied Transactions
Introduction to 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 language version - commands to request
CICS services - Single command can replace series of macros.
ONLINE SYSTEM
Data-Communication Functions
Data-Handling Functions
Application Program Services
System Services
Monitoring Functions
Task &Transaction
Task:- A basic unit of work which is scheduled by the operating system or CICS
E.g.; -Read from and write to the terminal
Pseudo-Conversational
Multitasking
Multithreading
Quasi-Reentrancy
Terminal Conversation
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
Pseudo-Conversational Example
Transaction TSK1
Program PROG1
PROCEDURE DIVISION.
:
EXEC CICS RECEIVE
END-EXEC.
:
EXEC CICS SEND
END-EXEC.
EXEC CICS RETURN
TRANSID (‘TSK2’)
END-EXEC.
CICS Components
Control Tables
Define the CICS environment
Functionally associated with the management module
Can modify working storage since a unique copy of working storage is created
for each task
- FILE SECTION, OPEN, CLOSE, and non-CICS READ & WRITE statements
are not permitted because file management is handled by CICS.
Introduction to BMS
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
Symbolic Map
Ensure device and format independence in the app pgm.
Symbolic Map is a map used by Application Program (DSECT)
Example
EMPMAPDFHMSD TYPE=MAP, X
MODE=INOUT, X
LANG=COBOL, X
STORAGE=AUTO, X
TIOAPFX=YES
*
ANY COMMENTS
•
Order of Macros
DFHMSD Macro
Example
EMPMSET DFHMSD TYPE=&SYSPARM , X
MODE=INOUT, X
LANG=COBOL, X
STORAGE=AUTO, X
TIOAPFX=YES, X
CNTL=(FREEKB,FRSET,PRINT)
DFHMDI Macro
Screen Layout
Where
& Attribute character
n Unprotected numeric
- Cursor
DFHMDF
Macro For The Above Layout
Attribute character
Skipper Technique
To skip the cursor to the next unprotected field after one unprotected field.
Screen Layout :
&xxxxx&$ &xx
where
$ Skipper field
& Attribute byte
X Unprotected field
Stopper Technique
AID KEYS
Indicates the method to initiate the transfer of information from terminal to CICS.
PF keys, PA keys, ENTER & CLEAR key
EIBAID contains, recently used AID code
Standard AID list - DFHAID
HANDLE AID establish the routines that are to be invoked when the aid is detected
by a RECEIVE MAP command
Syntax :
EXEC CICS HANDLE AID
Option (label)
END-EXEC Conditions: INVREQ
Numeric Sign : For input operations, Separate fields or CR/DR field approach
can be used and for output operations, PICOUT parameter can be given in macro
Decimal Point : For input operations, Virtual decimal point or Separate fields
approach can be used and for output operations, PICOUT parameter has to be given
in the field definition macro.
SEND MAP
Conditions : INVREQ,LENGERR
RECEIVE MAP
PROGRAM CONTROL
Commands
LINK
XCTL
RETURN
LOAD
RELEASE
LINK:
Syntax:
EXEC CICS LINK
PROGRAM(name)
[COMMAREA(data-area)
[LENGTH(data-value)]]
END-EXEC.
XCTL
To transfer control from one application program to another in the same logical level
The program from which control is transferred is released
Data can be passed to the called program using COMMAREA
If the called program is not already in main storage it is loaded
Syntax:
EXEC CICS XCTL
PROGRAM(name)
[COMMAREA(data-area)
[LENGTH(data-value)]]
END-EXEC.
RETURN
To return control from one application program to another at a higher logical level or
to CICS.
Data can be passed using COMMAREA when returning to CICS to the next task
Syntax:
EXEC CICS RETURN
[TRANSID(name)
[COMMAREA(data-area)
[LENGTH(data-value)]]]
END-EXEC.
Conditions: INVREQ, LENGERR
LOAD
To load program/table/map from the CICS DFHRPL concatenation library into the
main storage
Using load reduces system overhead
Syntax:
EXEC CICS Load
Program(name)
[SET (pointer-ref)]
[LENGTH (data-area)]
END-EXEC.
RELEASE
Syntax:
EXEC CICS RELEASE
PROGRAM(name)
END-EXEC.
COMMAREA
HANDLE CONDITION
Syntax :
EXEC CICS HANDLE CONDITION
ERROR(ERRHANDL)
LENGERR(LENGRTN)
END-EXEC
Syntax :
EXEC CICS IGNORE CONDITION
ITEMERR
LENGERR
END-EXEC
This command will not take any actions if the given two error occurs and will pass
the control to the next instruction.
Syntax of Pop :
EXEC CICS Pop
Handle
END-EXEC.
DFHPPT TYPE=ENTRY
PROGRAM |MAPSET= name
[PGMLANG= ASM|COBOL|PLI]
[RES= NO|FIX|YES]
:
: other options
:
Eg.
DFHPPT TYPE=ENTRY,PROGRAM=TEST,
PGMLANG=COBOL
PCT Entry
DFHPCT TYPE=ENTRY
TRANSID= name
PROGRAM=name
TASKREQ=pf6
RESTART=yes/no ( TRANSEC = 1to 64)
RSLKEY= 1 to 24 resource level key
SCTYKEY= 1 to 64 security key
:
:
other options
File Handling
VSAM
Different types of VSAM Datasets used in CICS are :
Adding a Record.
Modifying an Existing Record.
Deleting an Existing Record.
Browsing One or Selected or All Records.
Defining Files
In CICS, Files cannot be created, Files can be created using IDCAMS Utility.
Re-indexing, Creating new indexes, etc. should be done using IDCAMS Only.
Important Key-Words
Random READ
Sequential Read
Syntax of READNext/READPrev
EXEC CICS READNext | READPrev
FILE(name)
INTO(data-area)|SET(ptr-ref)
RIDFLD(data-area)
END-EXEC.
ENDBRowse
Condition: INVREQ
RESETBR
Its effect is the same as ENDBR and then giving another STARTBR.
Syntax:
EXEC CICS RESETBR
FILE(filename)
RIDFLD(data-area)
END-EXEC.
WRITE Command
Syntax :
EXEC CICS WRITE
FILE(filename)
FROM(data-area)
RIDFLD(data-area)
END-EXEC.
Syntax:
EXEC CICS REWRITE
FILE(filename)
FROM(data-area)
END-EXEC.
DELETE Command
Syntax:
EXEC CICS DELETE
FILE(filename)
RIDFLD(data-area) Optional
END-EXEC.
UNLOCK
To Release the Record which has been locked by READ with UPDATE Command.
Syntax:
EXEC CICS UNLOCK
FILE(filename)
:
[other options]
END-EXEC.
General Exceptions
The following Exceptions usually will occur for ALL CICS File Handling
Commands.
FILENOTFOUND,
NOTAUTH,
SYSIDERR,
INVREQ
CICS - DB2
RCT Entry
DB2 – Precompiler
Program Preparation
Introduction
Preparing a Program
Translation
Translates the ‘EXEC CICS’ Statements into the Statements your Language
(COBOL) Compiler can Understand.
The Translator gives two outputs, a Program Listing as SYSPRINT and a Translated
Source in SYSPUNCH.
The SYSPUNCH is given as the input to the Program Compiler.
If any Copy Books are used in the Program, there should not be any CICS Statements
in the Copy Book.
Compiling or Linking
As the CICS Commands have been translated, The Compilation of the CICS Program
is the same as Language Program.
Hence, the Compiler Options can be specified as required.
CESN/CESF Transactions