Professional Documents
Culture Documents
Day 1:
Introduction to CICS
Day 2:
Day 3: Day 4: Day 5:
WHAT IS CICS
Customer information control system It is a region where online transactions runs.
WHAT IS CICS
IBM definition: CICS is a DB/DC control system.
TERMINAL
VTAM BTAM TCAM CICS DB2
VSAM
DASD
Application Programs
WHAT IS CICS
Can be thought of as an OS within another OS
MVS OS
Database Access method DL/1, DB2 Data Access method VSAM,BDAM
Telecommunication Access Method VTAM, TCAM, BTAM
DASD
Terminals
CICS
Monitoring Services
System Services
System Services
Provides Program Control, such as loading and
multitasking features.
more than one CICS region in the same system can communicate.
Provides Inter System Communication (ISC), through
which a CICS region in one system can communicate with the CICS region on another system.
as IMS/DB, DB2.,
Monitoring Services
provides series of statistical information that can can be used for system tuning.
from the terminal. Information is always current. Output is displayed on the terminal.
Ex: Air line reservation system
or days.
Ex: Payroll application program.
Has better Keyboard Layout Keyboard could be configured for foreign languages
BASIC TERMINOLGIES
TRANSACTION: Transaction is the way of initiating the unit of work
The execution of a program will be initaited by a transaction id TRANSACTION ID:
Its an unique identifier defined for each program that is to be
executed in CICS region. An on line program will be executed by entering the transaction id on the terminal
TASK: It is a unit of work that is genereted when ever a transaction runs
Different unit of works will be generated if the same transaction runs at
different terminals
CICS Execute Sign ON CICS Execute Definition and Administration CICS Execute Master Terminal
CECI:
CEDF:
CMAC:
CESF:
(Terminal Control Table) (Program Control Table) (Processing Program Table) (File Control Table) (Temporary Storage Table) (Destination Control Table) (System Initialization Table)
Contains
information that describes the configuration of all the terminals and other CICS systems with which terminals can communicate.
Contains the list of all transactions that may be processed by the system. Includes details such as transaction- id, priority,
Contains the list of all programs that may be executed by the system. Include details such as program name, source language
and residency.
modified
by
various
(Terminal Control Program) (Task Control Program) (Program Control Program) (File Control Program) (Temporary Storage Program) (Storage Control Program) (System Initialization Program)
Locates and loads programs for execution Transfers control between programs Returns control to CICS
CICS region
CICS COMMANDS
CICS COMMANDS
CICS COMMANDS
TRANSACTION
CICS COMMANDS
TO END THE TRANSACTION AND TO INITIATE
CICS COMMANDS
TO END THE TRANSACTION AND TO INITIATE ANOTHER TRANSACTION
EXEC CICS RETURN TRANSID(<TRANSID>) COMMAREA(VAR) END-EXEC COMMAREA: USED TO SEND DATA TO ANOTHER PROGRAM NOTE: THE PROGRAM WHICH IS RECEIVING THE DATA SHOULD BE CODED WITH LINKAGE SECTION IN THE GIVEN BELOW FORMAT LINKAGE SECTION: 01 DFHCOMMAREA. 02 <VAR1> 02 <VAR2>
being received from main program EIBTRANID: contains the transaction id of the program EIBDATE: contains the date on wich the task has been started EIBTIME: contains the time on which the task has been started EIBTRMID: contains the id of the terminal on which the transaction is being executed EIBTASKN: contains the task no of the transaction EIBRESP: contains the response code of the cics command after its executed
MAP
TWO TYPES:
PHYSICAL MAP: Its the load module generated after compilation which is used to generate screen SYMBOLIC MAP: Its the copy member generated after compilation which contains variables to that are used to send and receive the data from the map.
MAP
MAPSET: COLLECTION OF MAPS. MAP: CONTAINS PROTECTED AND UN PROTECTED FIELDS.
CICS SUPPLIED ASSEMBLER MACROS TO DEFINE THE MAPS, MAPSET AND FIELDS
DFHMSD: TO DEFINE THE MAPSET AND TO END THE MAPSET DFHMDI: TO DEFINE THE MAP DFHMDF: TO DEFINE THE FIELDS
MAP
CODING FORMAT:
Parameters
Continuation
: Followed by macro
: X on 72 column
MAPSET PARAMETERS
TYPE:
SPECIFIES TYPE OF YHE MAP THAT IS TO BE GENERATED Values MAP : GENERATES ONLY PHYSICAL MAP
DSECT
&SYSPARM FINAL
MAPSET PARAMETERS
MODE:
SPECIFIES THE TYPE OF OPERATION THAT CAN BE DONE ON MAPS Values IN : INPUT OPERATION
OUT
: OUTPUT OPERATION
INOUT
: BOTH
MAPSET PARAMETERS
LANG:
SPECIFIES THE HOST LANGUAGE IN WHICH THE MAP IS BEING USED Values COBOL
PL1
ASM
For each field five fields will be generated 1. INPUT VARIABLE 2. OUTPUT VARIABLE 3. LENGTH VARIABLE 4. ATTRIBUTE VARIABLE 5. FLAG BYTE
SYMBOLIC MAP
If DSATTS parameter is specified on map definition then depending on the values of dsatts then the folloeing varibales will also be generat Colour variable with suffix C and PIC clause as X(1) Hilight variable with suffix H and PIC clause as X(1) Outline variable with suffix U and PIC clause as X(1)
SYMBOLIC MAP
INPUT VARIABLE:
To receive the data from tha map. After receiving the data will be in input variables. Input variable will be given the suffux i The default PIC clause will be alphanumeric if PICIN is not specified
SYMBOLIC MAP
OUTPUT VARIABLE: To send the data to the map. Before sending the map the data should be moved to output variables. Ouput variable will be given the suffux O The default PIC clause will be alphanumeric if PICOUT is not specified
SYMBOLIC MAP
LENGTH VARIABLE:
Contains the length of the data the user has enterd on the field. Length variable will be given the suffux L and the PIC clause is given as S9(4) COMP.
SYMBOLIC MAP
ATTRIBUTE VARIABLE:
Specifies the values of attribute parameter . The PIC clause is X(1). Each bit in this byte specifies one value of the parameter. It will having the suffix A
SYMBOLIC MAP
FLAG BYTE:
An alphanumeric variable with the PIC clause of X(1). Will conatain hexadecimal X80 If the field is modified else hexadecimal X00.
EXEC CICS
EXEC CICS
TRANSFER OF CONTROL
XCTL LINK
XCTL
USED TO TRANSFER THE CONTROL FROM ONE PROGRAM TO
ANOTHER PROGRAM
SYNTAX
COMMAREA(VAR)
LINK
USED TO TRANSFER THE CONTROL FROM ONE PROGRAM
TO ANOTHER PROGRAM
SYNTAX
DFHAID
IT IS A PREDEFINED COPY MEMBER THAT CAN COPIED
PSEUDO CONVERSATION
MULTIPLE TRANSACTIONS AND MULTIPLE PROGRAMS
PROGRAMS .
TRANSACTION-ID.
EXECUTION OF ANOTHER TRANSACTION THROUGH RETURN TRANSID(trans id) Ex: EXEC CICS RETURN TRANSID(T166) COMMAREA(VAR) END-EXEC.
EX:
EX: PROCEDURE DIVISION EVALUATE EIBTRNID WHEN T1 PERFORM ADD-PARA WHEN T2 PERFORM SUB-PARA WHEN T3 PERFORM MUL-PARA
------------
TO THE TERMINAL AND THE RESOURCES THAT ARE AQUIRED WILL BE FREED
AS WELL AS THE SAME TRANSACTION WILL BE INITIATED
BY SENDING A MESSAGE
WHEN THE TRANSACTION IS INITIATED FOR SECOND TIME
THE USER WILL COMPLETE THE RESPONSE AND FROM RECEIVE COMMAND ONWARDS THE PROGRAM WILL BE EXECUTED
EXCEPTION CONDITIONS
AEIK TERMIDERR AEXL DISABLED AEYB INVMPSZ AEYH QIDERR AEIL FILENOTFOUND AEIM NOTFND AEIN DUPREC AEIO DUPKEY AEIP INVREQ AEIQ IOERR AEIR NOSPACE AEIS NOTOPEN
AEIV LENGERR AEIW QZERO AEIZ ITEMERR AEI0 PGMIDERR AEI1 TRANSIDERR AEI2 ENDDATA AEI3 INVTSREQ AEI8 TSIOERR AEI9 MAPFAIL AEIT ENDFILE AEIU ILLOGIC
EXCEPTION HANDLING
RESP HANDLE CONDITION NOHANDLE IGNORE CONDITION
EXCEPTION HANDLING
RESP
RESP option can be coded in any cics command to handle the exception
conditions EX: EXEC CICS SEND MAP(mapname) MAPSET(map set name) RESP(<var>) END-EXEC. The variable should be coded in the working storage section with the PIC clause of s9(8) comp When ever a CICS command is executed the response code code will be placed in EIBRESP. If RESP is coded in the CICS command then the response code from EIBRESP will be moved to vraibale coded in RESP. Now the variable can be evaluated to handle the abend
EXCEPTION HANDLING
RESP Ex:
EXCEPTION HANDLING
EXEC CICS HANDLE CONITION <exception condition name1> <exception condition name2> END-EXEC.
When ever the exception condition occurs given in HANDLE command then the control will be transferred to the specified paragraph
Ex: EXEC CICS HANDLE CONITION MAPFAIL FILENOT FOUND END-EXEC
(MFAIL-PARA) (FNF-PARA)
The handle command will be in activation till another handle command appears in the code
NOHANDLE
EXCEPTION HANDLING
All the exception conditions the can occur will be ignored for
EXCEPTION HANDLING
IGNORE CONDITION Syntax: EXEC CICS IGNORE CONDITION <condiiton name1> <condition name2> END-EXEC. The specified exception conditions will be ignored if occurs in the command that is following the IGNORE CONDITION command and the control will be transferred to next command The ignore condition is applicable only for the command that is following the IGNORE CONDITION command
FILES
Accesing files from usng CICS-COBOL program Need not to contain file control paragraph
Should not contain OPEN and CLOSE statements CICS commands should be used to READ, WRITE, UPDATE
by online application.
File will be closed and opened explicitely in the CICS region
FILES
Defining file to CICS region
operation that can be done i.e READ, BROWSE, WRITE, REWRITE and DELETE.
EX:
CEDA DEF FILE(TCHFL167) NAME RECORD LENGTH OPERATIONS READ WRITE REWRITE DELETE : TCHN167.FILE1 : 80 : YES : YES : YES : YES
FILES
Modifying file definition to CICS region
FILES
READ COMMAND
EXEC CICS
END-EXEC.
INTO:
specifies the group name or variable to store the record after read is done. The variable should be declared in working storage section.
RIDFLD:
specifies the variable that contains the promary key of the record that is to be read
FILES
FILES
WRITE COMMAND
EXEC CICS
END-EXEC.
FROM:
specifies the group name or variable that contains the record to be written. The variable should be declared in working storage section.
RIDFLD:
specifies the variable that contains the promary key of the record that is to be written
FILES
DELETE COMMAND
EXEC CICS
RIDFLD:
specifies the variable that contains the promary key of the record that is to be deleted
REWRITE
FILES
COMMAND FOR READ WITH UPDATE OPTION EXEC CICS READ FILE(file name) INTO(var) RIDFLD(var) RESP(var) UPDATE END-EXEC. Once the record is read with update option the file will be locked. The file will be unlocked once the rewrite is done. If the rewrite is not going to happen then file should be unlocked with UNLOCK comman INTO: specifies the group name or variable to store the record after read is done. The variable should be declared in working storage section. RIDFLD: specifies the variable that contains the primary key of the record that is to be read
COMMAND FOR REWRITE AFTER READING EXEC CICS REWRITE FILE(file name) FROM(VAR) RESP(VAR) END-EXEC. FROM: the group name or variable that contains the record to be written The variable should be declared in working storage section.
COMMAND TO UNLOCK THE FILE EXEC CICS UNLOCK FILE(file name) RESP(VAR) END-EXEC.
WORKING-STORAGE SECTION. 000600 COPY TCHM167. 000600 COPY DFHAID. 000700 01 EMP-REC. 000800 02 EMPID PIC XXX. 000900 02 PIC X. 001000 02 EN PIC X(6). 001100 02 PIC X. 001200 02 EMPSAL PIC 9(5). 001300 02 PIC X(64). 001400 01 ERR PIC S9(8) COMP. 001500 PROCEDURE DIVISION. 001600 EXEC CICS 001700 SEND CONTROL ERASE 001800 END-EXEC. 001900 MOVE LOW-VALUES TO EMPO. 002000 MOVE 'ENTER ID AND PRESS ENTER' TO MS2O. 002100 EXEC CICS 002200 SEND MAP('EMP') MAPSET('TCHM167') 002300 END-EXEC. 002400 EXEC CICS 002500 RECEIVE MAP('EMP') MAPSET('TCHM167') 002600 END-EXEC. 002700 MOVE EIDI TO EMPID. 003000 EXEC CICS 003100 READ FILE('TCHFL167') INTO(EMP-REC) RIDFLD(EMPID) 003200 RESP(ERR) UPDATE 003300 END-EXEC.
003400 IF ERR = DFHRESP(NORMAL) 003410 MOVE EN TO ENAMEO 003420 MOVE EMPSAL TO ESALO 003430 PERFORM REWRITE-PARA 003600 ELSE 003700 IF ERR = DFHRESP(NOTFND) 003800 MOVE 'RECORD NOT FOUND' TO MS2O 003810 PERFORM EXIT-PARA 003900 ELSE 004000 MOVE 'ERROR' TO MS2O 004010 PERFORM EXIT-PARA 004100 END-IF 004200 END-IF. 004210 REWRITE-PARA. 004300 EXEC CICS 004400 SEND MAP('EMP') MAPSET('TCHM167') 004500 END-EXEC. 004510 EXEC CICS 004520 RECEIVE MAP('EMP') MAPSET('TCHM167') 004530 END-EXEC.
004551 IF EIBAID = DFHENTER 004552 MOVE ENAMEI TO EN 004553 MOVE ESALI TO EMPSAL 004554 EXEC CICS 004555 REWRITE FILE('TCHFL167') FROM(EMP-REC) RESP(ERR) 004556 END-EXEC 004557 MOVE 'REWRITTEN' TO MS2O 004558 ELSE 004559 IF EIBAID = DFHPF1 004560 EXEC CICS UNLOCK FILE('TCHFL167') END-EXEC 004561 MOVE 'UNLOCKED' TO MS2O 004562 END-IF 004563 END-IF. 004564 PERFORM EXIT-PARA. 004570 EXIT-PARA. 004600 EXEC CICS 004601 SEND MAP('EMP') MAPSET('TCHM167') 004602 END-EXEC. 004610 EXEC CICS 004700 RETURN 004800 END-EXEC.
BROWSE
FILES
EXEC CICS SATRTBR FILE(file name) END-EXEC. RIDFLD(var) RESP(var)
RIDFLD:
specifies the variable that contains the primary key of the record from which the read is to be started
COMMAND FOR READING ONE BY ONE
specifies the group name or variable to store the record after read is done. The variable should be declared in working storage section.
QUEUES
Queues are temporary files that will be managed by
CICS
Two types of queues TDQ (Transient Data Queue) TSQ (Temporary Storage Queue)
TDQ
Its a temprary file in which the records are writen in the order
TDQ
Operations on TDQ
Write: Records will be written in the order of there entry
Read: Records can only be read sequentially.
TDQ
Types of TDQ
INTRA PARTITION TDQ EXTRA PARTITION TDQ
BATCH jobs
These can be used to pass the data from one CICS program to
Ex: CEDA DEF TDQ(Q1) TYPE : EXTRA EXTRA PARTITION TDQ PARAMETERS TYPE : INPUT/OUTPUT FILE NAME : TCHN167.TSO.PS
transactions When the queue is opened in CICS region the records will be copied to the QUEUE from PS file Then the cics transactions can read records from the queue The records from the queue will be deleted once they are read
Batch process -> (write) PS
-> TDQ -> online prosess(read)
TSO
CICS
trabsactions The records that are written to QUEUE will be written to PS file Then the batch process can read records from the PS file
CICS
READ
TDQ commands
WRITE
EXEC CICS WRITEQ TD QUEUE(queue name) FROM(var) RESP(err) END-EXEC.
FROM:
specifies the group name or variable that contains the record to be written. The variable should be declared in working storage section.
NOTE:
TDQ commands
READ
EXEC CICS READQ TD QUEUE(queue name) INTO(var) RESP(err) END-EXEC.
INTO:
specifies the group name or variable to store the record after read is done. The variable should be declared in working storage section.
NOTE:
TDQ commands
DELETE
EXEC CICS DELETEQ TD QUEUE(queue name) RESP(err) END-EXEC.
NOTE:
FHDCT
TYPE=INTRA,
DESTID=MSGS TRANSID = MSW1 TRIGLEV = 1000
Same Txn ( from same terminal / diferent term) Different Txn (from same terminal / diferent term) dttttann d- Division id tttt Term id A- Appl code nn - Queue no.
TSQ continue...
Read ReadQ (direct read ) ReadQ ( Seq read )