Вы находитесь на странице: 1из 54

Customer Information

control system
Sridhar Babu Purama

Topics to be covered
- Introduction to CICS
- Task & Transaction
- Batch Vs Online Processing
- Steps involved in developing a CICS program
- Ways to initiate a transaction
- CICS Control tables
- BMS Macros
- CICS Setup process

Introduction to CICS
CICS (Customer Information Control System)
CICS is used for developing Online applications on Mainframes.
CICS itself acts as an Operating System under z/OS.

z/OS
CICS

P1

P2

P3

P4

P5

Introduction to CICS
CICS supports both multitasking and multithreading.
Multitasking : Executing different programs simultaneously is
Multitasking.
Multithreading : Executing different programs simultaneously and copies
of the same program simultaneously is Multithreading.

z/OS

CICS

P1

P2

P3

P1

P1

Task & Transaction


Transaction is a set of tasks.
Task is an instance of a transaction.
Eg : Tasks in ATM Transaction
1. Once the card is inserted, User is asked to enter the PIN.
2. PIN is validated.
If Valid
3. User is send OPTIONS screen
Otherwise
4. User is prompted to enter CORRECT PIN

Batch Vs Online Processing


BATCH

ONLINE

1. No User Interaction.
2. No CICS is used.
3. Batch processing is fast as there is no
user interaction.
4. Batch programs are compiled using
JCL.
5. Batch programs are executed using
JCL.
6. Eg : Payroll, Business Analysis &
Reporting application.

1. User Interaction will be there.


2. CICS is used.
3. Online processing is slow as there is user
interaction.
4. Online programs are compiled using JCL.
5. Online programs are executed using
Transaction ID (max. 4 Characters long).
6. Eg : ATM, Railway & Airline reservations.

Steps involved in developing a Online program


1. Design the map layout (screen layout).
2. Code the BMS macros for developing the map.
3. Compile the BMS macros to generate the physical and symbolic maps.
4. Setup the maps in CICS region using CEDA command.
5. Test the map layout using CECI command.
6. Design the program logic for the map layout.
7. Code the program for the corresponding map.
8. Compile the program to generate the load module.
9. Setup the program, transaction id, files, DB2 plans in CICS region using CEDA.
10. Test the program by initiating the transaction id.
11. Each time the BMS macros or the program is modified & compiled, the latest load
modules must be uploaded into CICS region using CEMT command.
12. To debug the CICS commands in the program, use CEDF command.

Ways to initiate a transaction


We can trigger a transaction / execute a CICS program in the below 5 ways :

By specifying the transaction id at the left topmost corner of the screen.


By using Pseudo-conversational programming i.e., using RETURN command.
By using XCTL and LINK commands.
By using ATI (Automatic Transaction Initiation).
By using START command.

CICS Control Tables


PCT (Program Control Table) : It holds the Transaction IDs and the corresponding
Program IDs.
PPT (Processing Program Table) : It holds the Program IDs and the corresponding
Load libraries.
FCT (File Control Table) : It holds the logical & physical file names.
RCT (Resource Control Table) : It holds the Program ID and the corresponding DB2
Plan.

CICS Control Tables


TR01

PCT
TR01 PROG1
TR02 PROG2
TR03 PROG3

PPT
PROG1
PROG2

FSSADM.CICS.LOADLIB
FSSADM.CICS.LOADLIB

FSS142.ACCTS.FILE
FSS146.POL.FILE

USER ID :
PASSWORD :
ENTER:LOGIN

FCT
ACCTFL
POLFL

LIC

RCT
PROG1
PROG2
PROG3

PLN1
PLN1
PLN1

Designing maps using BMS Macros


BMS is Basic Mapping Support
BMS is a set of assembly language macros used to develop a map.
MAP is a single CICS screen layout.
MAPSET is a set of related maps.
There are 3 important macros :
1. DFHMSD (Defined Field Hierarchy MapSet Definition)
It is used to define the mapset.
2. DFHMDI (Defined Field Hierarchy Map Definition Interpreter)
It is used to define the define the map in the mapset.
3. DFHMDF (Defined Field Hierarchy Map Definition Field)
It is used to define the fields in the maps.

BMS Macros for LOGIN map


ICIMST1

DFHMSD TYPE=&SYSPARM/MAP/DSECT, MODE=INOUT/IN/OUT,


STORAGE=AUTO, LANG=COBOL / PL/1/ ASM,
X
TIOAPFX=YES, CTRL=(FRSET,FREEKB)

ICIMP1

DFHMDI

SIZE=(24,80), LINE=1, COLUMN=1

DFHMDF INITIAL=ICICI', POS=(1,38), LENGTH=05, ATTRB=ASKIP


DFHMDF INITIAL=- - - - - ', POS=(2,38), LENGTH=05, ATTRB=ASKIP
DFHMDF INITIAL='USER ID :', POS=(10,31), LENGTH=10, ATTRB=ASKIP
UID
DFHMDF POS=(10,42), LENGTH=10, ATTRB=(UNPROT, FSET, IC)
DFHMDF POS=(10,53), LENGTH=01, ATTRB=ASKIP
DFHMDF INITIAL='PASSWORD : ', POS=(11,31), LENGTH=10, ATTRB=ASKIP
PWD
DFHMDF POS=(11,42),LENGTH=10, ATTRB=(UNPROT, FSET, DRK)
DFHMDF POS=(11,53),LENGTH=01, ATTRB=PROT
DFHMDF INITIAL='ENTER:LOGIN
F5:REFRESH', POS=(20,21),
X
LENGTH=50, ATTRB=ASKIP
ERRMSG DFHMDF POS=(22,11), LENGTH=50, ATTRB=(ASKIP, BRT)
ICIMST1 DFHMSD TYPE=FINAL
END

BMS Macros
TYPE : It specifies the type of map to be generated.
TYPE=MAP
Only Physical map is generated.
TYPE=DSECT Only Symbolic map is generated.
TYPE=&SYSPARM
Both Physical & Symbolic maps are generated.

Compilation of BMS macros


Once BMS macros are written, compile it using CICSMAP JCL.
It will generate Physical and Symbolic maps.
Physical Map is the load module to be executed.
Symbolic Map is the copybook with the map variables.

BMS Macros
MODE : It specifies the type of usage of map.
MODE=INOUT
MODE=IN
MODE=OUT

Map can be used for both input & output purpose.


Map can be used for ONLY input purpose.
Map can be used for ONLY output purpose.

STORAGE=AUTO
It will allocate separate memories for each map in the mapset. This will
avoid any overlapping of maps.
LANG

It specifies the programming language with which the map can be used.

TIOAPFX (Terminal Input Output Area Prefix) :


When TIOPFX=YES is specified, then a 12-byte filler is generated for holding the control
information(function key information).
FREEKB
SIZE

It unlocks the keyboard before sending the map.


It specifies the size of the map to be displayed.

LINE & COLUMN

Specify the position of the map on the CICS screen.

BMS Macros
INITIAL

It is similar to VALUE clause in assigning the data statically to a field.

LENGTH

It specifies the length of the field.

POS It specifies the position of the field in the map.


ATTRB
It specifies the characteristics of a field.
ASKIP(Autoskip)
It skips the control over the field.
UNPROT
It stops the control at the field and allows the user to enter the data.
PROT
It stops the control at the field but does not allow the user to enter the
data.
BRT
It displays the field with Bright intensity.
DRK
It darkens the field making it invisible.

Symbolic Map
01 ICIMP1I.
02 FILLER
PIC X(12).
02 UIDL
PIC S9(4) COMP.
02 UIDF
PIC X.
02 FILLER
REDEFINES UIDF.
03 UIDA
PIC X.
02 UIDI
PIC X(10).
02 PWDL
PIC S9(4) COMP.
02 PWDF
PIC X.
02 FILLER
REDEFINES PWDF.
03 PWDA
PIC X.
02 PWDI
PIC X(10).
02 ERRMSGL
PIC S9(4) COMP.
02 ERRMSGF
PIC X.
02 FILLER
REDEFINES ERRMSGF.
03 ERRMSGA
PIC X.
02 ERRMSGI
PIC X(50).
01 ICIMP1O
REDEFINES ICIMP1I.
02 FILLER
PIC X(12).
02 FILLER
PIC X(3).
02 UIDO
PIC X(10).
02 FILLER
PIC X(3).
02 PWDO
PIC X(10).
02 FILLER
PIC X(3).
02 ERRMSGO
PIC X(50).

Symbolic map variables


For every field declared in the BMS, 5 variables are generated.
FIELD + L
FIELD + F
field.
FIELD + A
FIELD + I
FIELD + O

It is the length field which stores the count of characters entered by user in the field.
It is the flag field which is used to know whether user has entered data or not in the
It is the Attribute field which is used to dynamically change the attributes of a field.
It is the Input field which is used to receive the data from Map to program.
It is the Output field which is used to pass the data from program to map.

Topics to be covered
- SEND & RECEIVE commands
- DFHAID & EIBAID
- XCTL & LINK commands
- Accessing VSAM KSDS Files in CICS programs
- Cursor Positioning Techniques
- Exception Handling
- Queues TSQs & TDQs
- CICS Transactions
- CICS program compilation process

Pseudo Conversational Programming


This programming technique is used to terminate the program till the user responds. Once
user responds by pressing a function key, the program again initiates its execution.
This way, no CPU resources are wasted till the user responds.
Pseudo-conversation is handled using RETURN command.
RETURN command : It is used to terminate the CICS program and pass the control to the
next immediate higher level.
EXEC CICS
RETURN
END-EXEC.
Pseudo-conversation syntax :
EXEC CICS
RETURN
TRANSID(HD01)
END-EXEC.

COMMAREA
It is the communication area between COBOL and CICS.
It is used to pass data between two CICS programs. We can pass a maximum of 32K
data.
While using pseudo-conversation, data keyed in by the user is initially held in
COMMAREA.
COMMAREA is used in the program as follows :
DATA DIVISION.
LINKAGE SECTION.
01 DFHCOMMAREA
PIC X(100).
EIBCALEN (Exec Interface Block Communication Area Length) : EIBCALEN is used to
know whether user has entered data on the map or not. It stores the count of characters.
If EIBCALEN = 0, it indicates user has NOT entered data on the map.
If EIBCALEN > 0, it indicates user has entered data on the map.

IDENTIFICATION DIVISION.
PROGRAM-ID. LOGPGM.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-COMMAREA PIC X(8) VALUE 'LOGIN1'.
COPY DFHAID.
COPY HDFCMST.
EXEC SQL
INCLUDE SQLCA
END-EXEC.
EXEC SQL
INCLUDE LTAB
END-EXEC.
LINKAGE SECTION.
01 DFHCOMMAREA
PIC X(100).
PROCEDURE DIVISION.
MAIN-PARA.
IF EIBCALEN = 0
MOVE LOW-VALUES TO HDFCMP1I,
HDFCMPIO
PERFORM 1500-SEND-HDFCMPI
ELSE
PERFORM 3000-PROCESS-PARA
END-IF.
EXEC CICS
RETURN
TRANSID('HD01')
COMMAREA(WS-COMMAREA)
END-EXEC.
1500-SEND-HDFCMPI.
EXEC CICS
SEND MAP('HDFCMPI')
MAPSET('HDFCMST')
END-EXEC.
2000-RECEIVE-PARA.
EXEC CICS
RECEIVE
MAP('HDFCMPI')
MAPSET('HDFCMST')
INTO(HDFCMP1I)
END-EXEC.

3000-PROCESS-PARA.
EVALUATE EIBAID
WHEN DFHENTER
PERFORM 2000-RECEIVE-PARA
PERFORM 3500-VALIDATE-PARA
WHEN DFHPF5
MOVE LOW-VALUES TO HDFCMPII
PERFORM 1500-SEND-HDFCMPI
WHEN OTHER
MOVE 'INVALID KEYPRESSED' TO ERRMSGO
PERFORM 1500-SEND-HDFCMPI
END-EVALUATE.
3500-VALIDATE-PARA.
MOVE
UIDI TO
HV-UID.
EXEC SQL
SELECT PASSWORD INTO :HV-PASSWORD
FROM LTAB
WHERE UID = :HV-UID
END-EXEC.
EVALUATE SQLCODE
WHEN 0
IF PWDI = HV-PASSWORD
MOVE LOW-VALUES TO ERRMSGO
PERFORM 1500-SEND-HDFCMPI
EXEC CICS
XCTL PROGRAM('HDFCP02')
END-EXEC
ELSE
MOVE 'INVLALID PASSWORD ENTERED'
TO ERRMSGO
PERFORM 1500-SEND-HDFCMPI
END-IF
WHEN 100
MOVE 'INVALID USER ID ENTERED' TO
ERRMSGO
PERFORM 1500-SEND-HDFCMPI
END-EVALUATE.

DFHAID & EIBAID


DFHAID (Defined Field Hierarchy Attention Identifier)
It is a system defined copybook which holds the function key information.
COPY DFHAID.
The above statement is resolved during compilation as follows :
01 DFHAID.
03 DFHENTER
03 DFHPF1
03 DFHPF2
03 DFHPF3
03 DFHPF4

PIC
PIC
PIC
PIC
PIC

----------------

VALUE ?.
VALUE /.
VALUE ;.
VALUE ).
VALUE ,.

EIBAID holds the function key information which User has pressed.
Suppose, User presses ENTER key, then ? is stored in EIBAID.
EVALUATE EIBAID
WHEN ENTER
PERFORM - - - - WHEN DFHPF1
PERFORM - - - - -

SEND Command
EXEC CICS
SEND MAP(ICIMP1)
MAPSET(ICIMST1)
END-EXEC.

SEND command is used to send both Physical & Symbolic maps


EXEC CICS
SEND MAP(ICIMP1)
MAPSET(ICIMST1)
MAPONLY
END-EXEC.

MAPONLY is used to send only Physical map


EXEC CICS
SEND MAP(ICIMP1)
MAPSET(ICIMST1)
DATAONLY
END-EXEC.

DATAONLY is used to send only Symbolic map

SEND Command
EXEC CICS
SEND MAP(ICIMP1)
MAPSET(ICIMST1)
ERASE/ERASEUP
ALARM
END-EXEC.

ERASE will clear the CICS screen before sending the map
ERASEAUP will clear the fields before sending the map
ALARM will give a beep sound once the map is displayed.

RECEIVE Command
RECEIVE command is used to receive the data from map into INPUT variables of the
map.
EXEC CICS
RECEIVE MAP(ICIMP1)
MAPSET(ICIMST1)
INTO(ICIMP1I)
END-EXEC.
RECEIVE command executes successfully when all the fields MDT value is turned to
ON or set to 1.
If any of the fields MDT is still OFF or 0, then it abends with MAPFAIL.

XCTL & LINK Commands


XCTL command is used to pass the control from one program to another program but
does not expect the control to return.
LINK command is used to pass the control from one program to another program but
expects the control to return.

Cursor Positioning
Techniques

In 3 ways, we can set the cursor position at a particular field.


1. Static Cursor Positioning Technique
2. Dynamic Cursor Positioning Technique
3. Relative Cursor Positioning Technique

Static Cursor Positioning Technique


Statically, we can set the cursor position using IC.
Example :
UID

DFHMDF

POS=(10,42), LENGTH=10, ATTRB=(UNPROT,FSET,IC)

Note 1 : Each time map is displayed cursor is always positioned at the same field
where IC is specified.
Note 2 : When IC is NOT specified, then cursor is positioned at the 1st byte in the
map.
Note 3 : When IC is specified for more than one field, then cursor is positioned at the
last UNPROT and IC specified field.

Dynamic Cursor Positioning Technique


Dynamically i.e., during execution we can change the cursor position by moving -1 to
the variables length field..
Example :
EVALUATE SQLCODE
WHEN 0
IF
PWDI = :HV-PASSWORD
EXEC CICS
XCTL PROGRAM(OPTPGM)
END-EXEC
ELSE
MOVE INVALID PASSWORD ENTERED
MOVE -1
TO PDWL
PERFORM 1500-SEND-HDFCMP1
END-IF
WHEN 100
END-EVALUATE.

TO ERRMSGO

Relative Cursor Positioning Technique


Dynamically i.e., during execution we can change the cursor position by specifying the
relative byte number while sending the map.
Example :
EVALUATE SQLCODE
WHEN 0
IF
PWDI = :HV-PASSWORD
EXEC CICS
XCTL PROGRAM(OPTPGM)
END-EXEC
ELSE
MOVE INVALID PASSWORD ENTERED
EXEC CICS
SEND MAP(HDFCMP1)
MAPSET(HDFCMST1)
CURSOR(842)
END-EXEC
END-IF
WHEN 100
END-EVALUATE.

TO ERRMSGO

Accessing VSAM KSDS Files


VSAM KSDS files are used in online programming for storing & accessing data
efficiently.
Records are stored in sorted order of key field.
These files support Sequential, Random and Dynamic access to records.

Writing new record


EXEC CICS
WRITE FILE(ACCTFL)
RIDFLD(ACCT-NUM)
FROM(ACCT-REC)
END-EXEC.
RIDFLD (Record Identification Field)
It is used to specify the key field value based on which records are accessed.

Reading records
sequentially

Reading the records sequentially from 1st record


MOVE LOW-VALUES TO ACCT-NUM.
EXEC CICS
STARTBR FILE(ACCTFL)
RIDFLD(ACCT-NUM)
KEYLEN(0)
END-EXEC.
PERFORM UNTIL WS-EOF = Y
EXEC CICS
HANDLE CONDITION
ENDFILE(9100-ENDFILE-PARA)
END-EXEC
--------EXEC CICS
READNEXT FILE(ACCTFL)
INTO(ACCT-REC)
END-EXEC
END-PERFORM.
EXEC CICS
ENDBR FILE(ACCTFL)
END-EXEC.

9100-ENDFILE-PARA.
MOVE Y TO WS-EOF.

Reading records
sequentially

Reading the records sequentially from LAST record


MOVE HIGH-VALUES TO ACCT-NUM.
EXEC CICS
STARTBR FILE(ACCTFL)
RIDFLD(ACCT-NUM)
KEYLEN(0)
END-EXEC.
PERFORM UNTIL WS-EOF = Y
EXEC CICS
HANDLE CONDITION
ENDFILE(9100-ENDFILE-PARA)
END-EXEC
--------EXEC CICS
READPREV FILE(ACCTFL)
INTO(ACCT-REC)
END-EXEC
END-PERFORM.
EXEC CICS
ENDBR FILE(ACCTFL)
END-EXEC.

9100-ENDFILE-PARA.
MOVE Y TO WS-EOF.

Reading records randomly


EXEC CICS
READ FILE(ACCTFL)
RIDFLD(ACCT-NUM)
INTO(ACCT-REC)
LENGTH(90)
GENERIC
END-EXEC.
LENGTH specifies the length of the record.
GENERIC just allows to read the data.
STARTBR sets the cursor position at a desired record.
To set the cursor position at the first record, move LOW-VALUES to key field.
To set the cursor position at the last record, move HIGH-VALUES to key field.
KEYLEN specifies the length of the key field.
READNEXT retrieves the records sequentially in FORWARD direction.
READPREV retrieves the records sequentially in REVERSE direction.
ENDBR terminates the sequential access to file data.

Updating a record
EXEC CICS
READ FILE(ACCTFL)
RIDFLD(ACCT-NUM)
INTO(ACCT-REC)
LENGTH(90)
UPDATE
END-EXEC.

UPDATE allows to modify the read data.

MOVE AMEERPET TO ACCT-HLDR-ADDR.


EXEC CICS
REWRITE FILE(ACCTFL)
RIDFLD(ACCT-NUM)
FROM(ACCT-REC)
END-EXEC.

Deleting a record
EXEC CICS
DELETE FILE(ACCTFL)
RIDFLD(ACCT-NUM)
END-EXEC.

ID DIVISION.
PROGRAM-ID. HDFCP03.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY DFHAID.
COPY HDFCMP3.
01 WS-COMMAREA.
03 FILLER
PIC X(50).
03 WS-COMM-PGM-ID PIC X(10).
03 WS-COMM-POL-NUM
PIC X(20).
03 WS-COMM-ERRMSG
PIC X(50).
LINKAGE SECTION.
01 DFHCOMMAREA
PIC X(130).
PROCEDURE DIVISION.
MAIN-PARA.
IF EIBCALEN = 0
PERFORM 1500-SEND-HDFCMP3
ELSE
MOVE DFHCOMMAREA TO WSCOMMAREA
IF WS-COMM-PGM-ID = HDFCP04'

ID DIVISION.
PROGRAM-ID. HDFCP04
DATA DIVISION.
WORKING-STORAGE SECTION.
01 POL-REC.
03 POL-NUM

WHEN DFHRESP(NOTFND)

PIC X(10).

03 POL-HLDR-NAME

PIC X(20).

03 POL-AMT

PIC 9(15).

COPY DFHAID.
COPY HDFCMP4.
01 WS-COMMAREA.
03 FILLER

MOVE 'INVALID POL NUM' TO


WS-COMMERRMSG
MOVE P4
TO WS-COMM-PGMID
EXEC CICS
XCTL PROGRAM(HDFCP03')
COMMAREA(WS-COMMAREA)
END-EXEC
END-EVALUATE.
3000-PROCESS-PARA.

PIC X(50).
EVALUATE EIBAID

03 WS-COMM-PGM-ID

PIC X(10).

03 WS-COMM-POL-NUM

PIC X(20).

03 WS-COMM-ERRMSG

PIC X(50).

WHEN DFHPF3
EXEC CICS
XCTL PROGRAM(HDFCP03')

MOVE SPACES TO WS-COMMPGM-ID

LINKAGE SECTION.
END-EXEC
01 DFHCOMMAREA
PIC X(130).
WHEN DFHPF12
PROCEDURE DIVISION.
MAIN-PARA.
EXEC CICS
MOVE DFHCOMMAREA TO WSXCTL PROGRAM(HDFCP01')
ELSE
COMMAREA.
IF WS-COMM-PGM-ID = HDFCP03'
PERFORM 3000-PROCESS-PARA
END-EXEC
MOVE SPACES TO WS-COMM-PGM-ID WHEN OTHER
PERFORM 2500-RETRIEVE-POL-DET
END-IF
END-IF.
ELSE
MOVE 'INVALID KEY PRESSED' TO
EXEC CICS
PERFORM 3000-PROCESS-PARA
ERRMS3O
RETURN
END-IF.
PERFORM 1500-SEND-HDFCMP4
TRANSID(HDO3')
EXEC CICS
COMMAREA(WS-COMMAREA)
RETURN
END-EVALUATE.
END-EXEC.
TRANSID(HDO4')
3000-PROCESS-PARA.
COMMAREA(WS-COMMAREA)
EVALUATE EIBAID
END-EXEC.
2500-RETRIEVE-POL-DET.
WHEN DFHENTER
MOVE WS-COMM-POL-NUM TO POLPERFORM 2000-RECEIVE-HDFCMP3
NUM.
MOVE POLNUMI TO WS-COMMEXEC CICS
MOVE WS-COMM-ERRMSG TO
ERRMSGO
PERFORM 1500-SEND-HDFCMP3

Queues
Queue is a storage area similar to file in storing records.
A Queue is identified using a Queue ID, which can be of maximum 8 characters long.
Queues are of two types :
1. TSQ (Temporary Storage Queue)
2. TDQ (Transient Data Queue)

TSQ Vs TDQ
TSQ
1. Records are stored based on Item
number.
2. Records can be accessed
sequentially and randomly.
3. Records can be read multiple times.
4. TSQs are registered in TST
(Temporary Storage Table).

1.
2.
3.
4.

TDQ
Records are stored without Item
number.
Records can be accessed only
sequentially.
Records can be read only once as
the record gets deleted once it is
read.
TDQs are registered in DCT
(Destination Control Table).

TSQ Vs TDQ
Writing records into TSQ
MOVE 1 TO WS-ITEM-NUM.
EXEC CICS
WRITEQ TS
QUEUE(QID001)
ITEM(WS-ITEM-NUM)
FROM(WS-TSQ-REC)
END-EXEC.

Reading records from TSQ


MOVE 1 TO WS-ITEM-NUM.
EXEC CICS
READQ TS
QUEUE(QID001)
ITEM(WS-ITEM-NUM)
INTO(WS-TSQ-REC)
END-EXEC.

Deleting TSQ :
EXEC CICS
DELETEQ TS
QUEUE(QID001)
END-EXEC.

Writing records into TDQ


EXEC CICS
WRITEQ TD
QUEUE(QID001)
FROM(WS-TDQ-REC)
END-EXEC.

Reading records from TDQ


EXEC CICS
READQ TD
QUEUE(QID001)
INTO(WS-TDQ-REC)
END-EXEC.

Deleting TDQ :
EXEC CICS
DELETEQ TD
QUEUE(QID001)
END-EXEC.

TDQs
TDQs are of two types :
1. Intra Partitioned TDQ.
2. Extra Partitioned TDQ.
Intra : These TDQs can be used in only one and in the same CICS region.
Extra : These TDQs can be used in more than one CICS regions and outside CICS
also.
DCT Entry for a TDQ :
DFHDCT TYPE=INTRA / EXTRA
QUEUE=QID001
TRGLEV=30
TRANSID=TR03
ATI (Automatic Transaction Initiation) :
When the Trigger level specified is reached, then the Transaction ID specified is
automatically initiated.

Page Up Page Down Logic


TSQs are used in Page Up - Page Down (F7 F8) logic.
1. Read the file sequentially and load the desired records into the TSQ.
2. Send the first 10 TSQ records on to the screen.
3. Evaluate EIBAID
WHEN F7 KEY
If already first 10 TSQ records are displayed.
then throw a message ALREADY AT THE TOP
Otherwise
Suppose (31-40) TSQ records are displayed,
then subtract 19 from 40 (40-19=21) and display from 21 to 30
End-if
WHEN F8 KEY
If already last 10 TSQ records are displayed.
then throw a message ALREADY AT THE BOTTOM
Otherwise
Suppose (11-20) TSQ records are displayed,
then ADD +1 to 20 (20+1=21) and display from 21 to 30
End-if

Handling exceptions in
CICS
When CICS cannot successfully process
a statement, it throws an exception.
We can handle exceptions in two ways :
1. Using HANDLE CONDITION.
2. Using RESP

HANDLE CONDITION :
It is used to handle exceptions in CICS.
HANDLE CONDITION must be specified before the CICS command.
Eg :

EXEC CICS
HANDLE CONDITION
NOTFND(9100-NOTFND-PARA)
NOTAUTH(9200-NOTAUTH-PARA)
END-EXEC.
EXEC CICS
READ FILE(POL-FILE)
RIDFLD(POL-NUM)
INTO(POL-REC)
END-EXEC.

9100-NOTFND-PARA.
MOVE INVALID POLICY NUMBER TO ERRMSGO
PERFORM 1500-SEND-ICIMP1
9200-NOTAUTH-PARA.
MOVE YOU DO NOT HAVE AUTHORIZATION TO ERRMSGO
PERFORM 1500-SEND-ICIMP1

RESP :
It is used to handle exceptions in CICS.
RESP must be specified after the CICS command.
Eg :

EXEC CICS
READ FILE(POL-FILE)
RIDFLD(POL-NUM)
INTO(POL-REC)
LENGTH(90)
END-EXEC.
EVALUATE EIBRESP
WHEN DFHRESP(NORMAL)
EXEC CICS
XCTL PROGRAM(PROG4)
END-EXEC
WHEN DFHRESP(NOTFND)
MOVE INVALID POLICY NUMBER TO ERRMSGO
PERFORM 1500-SEND-ICIMP1
WHEN DFHRESP(NOTAUTH)
MOVE YOU DO NOT HAVE AUTHORIZATION TO ERRMSGO
PERFORM 1500-SEND-ICIMP1
END-EVALUATE.

RESP :
It is used to handle exceptions in CICS.
RESP must be specified after the CICS command.
Eg :

EXEC CICS
READ FILE(POL-FILE)
RIDFLD(POL-NUM)
INTO(POL-REC)
LENGTH(90)
RESP(WS-RESP)
END-EXEC.
EVALUATE WS-RESP
WHEN DFHRESP(NORMAL)
EXEC CICS
XCTL PROGRAM(PROG4)
END-EXEC
WHEN DFHRESP(NOTFND)
MOVE INVALID POLICY NUMBER TO ERRMSGO
PERFORM 1500-SEND-ICIMP1
WHEN DFHRESP(NOTAUTH)
MOVE YOU DO NOT HAVE AUTHORIZATION TO ERRMSGO
PERFORM 1500-SEND-ICIMP1
END-EVALUATE.

RESPONSE CODES
General Response Codes that can be generated :
NORMAL
- Successful execution and record found
NOTAUTH(AEY7) - User does not have authorization
NOTFND(AEIM)
- Record not found
ENDFILE(AEXK) - End of the file reached
PGMIDERR(AEI0) - Program/Map name is incorrect (Not found in PPT)
TRNIDERR(AEI1) - Transaction ID is incorrect (Not found in PCT)
MAPFAIL
- When any of the fields MDT is still zero, the RECEIVE
command fails with MAPFAIL abend
LENGERR(AEIV) - Record length of file and specified length do not match
DUPREC(AEIN)
- Duplicate record as key field already exists
INVREQ(AEIP)
- Trying to write a record without WRITE access
QIDERR(AEYH)
- Queue ID specified is incorrect

CICS System Defined Transactions


CEDA (CICS EXECUTION DYNAMIC ALLOCATION)
It is used to define and install mapsets, programs, transaction ids, files and Db2 plans.
To define & install a mapset into PPT :
CEDA DEF MAPSET(ICIMST1) GROUP(ICICI)
CEDA INS MAPSET(ICIMST1) GROUP(ICICI)
To define & install a program into PPT :
CEDA DEF PROGRAM(ICIP01) GROUP(ICICI)
CEDA INS PROGRAM(ICIP01) GROUP(ICICI)
To define & install a transaction id into PCT :
CEDA DEF TRANS(IC01) PROGRAM(ICIP01) GROUP(ICICI)
CEDA INS TRANS(IC01) GROUP(ICICI)
To define & install a file into FCT :
CEDA DEF FILE(LOGFL) GROUP(ICICI)
FSS141.LOGIN.FILE
CEDA INS FILE(LOGFL) GROUP(ICICI)

CICS System Defined Transactions


CEDA (CICS EXECUTION DYNAMIC ALLOCATION)
To define & install a DB2 PLAN into RCT :
CEDA DEF DB2E(LOGE) GROUP(ICICI)
PLAN(FSSCCSPL)
CEDA INS DB2E(LOGE) GROUP(ICICI)
CEDA DEF DB2T(LOGT) GROUP(ICICI)
DB2E - LOGE
TRAN IC03
CEDA INS DB2T(LOGT) GROUP(ICICI)

CICS System Defined Transactions


CEMT (CICS EXECUTION MASTER TERMINAL)
CEMT INQUIRE TRAN(IC01)
- PROG(ICIP01)
It will give program name associated with the transaction id.
CEMT I PROG(ICIP01)
- TRAN(IC01)
It will give transaction id associated with the program name.
CEMT I FILE(LOGFL)
- FSS141.LOGIN.FILE OPENED ENABLED REA UPD ADD DEL
CLOSED DISABLED
It will give physical file name associated with the logical file name.
CEMT SET PROG(ICIP01) NEWCOPY
Each time we modify the program or BMS macros, we compile and execute the
above command.
NEWCOPY will override the existing load module version with the latest one.

CICS System Defined Transactions


CESN (CICS EXECUTION SIGN ON) : It is used to sign on to the CICS region.
CESF (CICS EXECUTION SIGN OFF) : It is used to sign off from the CICS region.
CEBR (CICS EXECUTION BROWSE) : It is used to browse the Queue data.
CEDF (CICS EXECUTION DIAGNOSTIC FACILITY) : It is used to debug the CICS
commands in the program.
CEDF

IC01

SEND MAP
-----------

EDF MODE ON

RETURN
TRANS(IC01)
-----------

ICICI
USER ID
:
PASSWORD :
ENTER: LOGIN

CICS System Defined Transactions


CECI (CICS EXECUTION COMMAND INTERPRETER)
It is used to test the map layout without using any program.
CECI SEND MAP(MAP1) MAPSET(MAPST1)

Вам также может понравиться