You are on page 1of 109

Course Plan

Day 1:

Introduction to CICS

Day 2:
Day 3: Day 4: Day 5:

Basic Mapping Support


Application Programming Advanced Application Programming CICS Control Operations

Agenda for Day 1


To understand what is CICS To realize the need for CICS under MVS To learn about IBM 3270 terminals To get familiar with CICS nucleus

To understand a CICS transaction life cycle


Structure of a CICS-COBOL program

Hello World! Program development and execution

WHAT IS CICS
Customer information control system It is a region where online transactions runs.

Its a Data Base Bata Communication(DBDC) method


Its also termed as online transaction process(OLTP) Provides facilities to bulid and display the formatted screens

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

Data handling Services

System Services

Application Program Services

Data Communication Services

CICS Application Programs (COBOL, PL/1, Assembly)

System Services
Provides Program Control, such as loading and

releasing of application programs.


Provides Storage Control, such as acquiring and

releasing of main storage.


Provides Task Control, such as task scheduling &

multitasking features.

Data Communication Services


Interfaces with telecommunication access methods such as

BTAM, VTAM, etc.,


Release application programs from the burden of dealing

with terminal hardware through Basic Mapping Support(BMS).


Provides Multi Region Operation(MRO), through which

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.

Data Handling Services

Provides interface with data access methods such as

BDAM, VSAM, etc.,


Provides interface with database access methods such

as IMS/DB, DB2.,

Application Programming Services


Interfaces with application programs.

Provides CICS command level translation.


Provides services like
CICS Execution Diagnostic Facility and CICS Enhanced Command Interpreter

Monitoring Services

Monitors various events within CICS address space and

provides series of statistical information that can can be used for system tuning.

Why is CICS needed under MVS?

To ease the development of Online applications.

Difference bet. Batch and Online Processing


Data is batched together before processing. Data is sequential from Tape or Disk. Data is entered individually, in any order. Transactions are initiated

Output consists of printed reports or updated master files


Job is scheduled and output is available in hours

from the terminal. Information is always current. Output is displayed on the terminal.
Ex: Air line reservation system

or days.
Ex: Payroll application program.

What are the advantages of using CICS?


Eases the development of online applications by providing
Format independence Device independence Remote execution facility Locking facility Portability across systems

Data communication and data handling functions

What are the advantages of using CICS?

Provides excellent security features


Terminal operators may be made to sign on Operators may be restricted to certain transactions Transactions can be made available to specific terminals

Application programs can further check

login/passwords and terminal locations

IBM 3270 Terminals


Mainly consists of

1. Monitor and 2. A Keyboard.


Examples:

1. 3278 (Monochrome, usually Green, White or Amber)


2. 3279 (7 different colours)

Has better Keyboard Layout Keyboard could be configured for foreign languages

IBM 3270 Terminals (2 of 3) CRT Monitor

Capable of displaying up to 1920 characters along 24 rows and 80 columns.

IBM 3270 Terminals (3 of 3) Key board


Aid Keys PF keys PF1 to PF24 & ENTER PA keys PA1 to PA4 & CLEAR Non-Aid Keys Alphabets, numbers punctuation and special characters.

Allows transfer of data. Doesnt allow transfer of data.

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

Different ways initiating a Transaction


By submitting a JCL. Runs SIP which uses SIT By a transaction identifier entered at the terminal with ENTER key By a transaction identifier associated with a terminal for pseudo-conversation By the START command which initiates for transaction specified in the parameter By Automatic Task Initiation (ATI) By an Aid key associated with the transaction in PCT

IBM SUPPLIED CICS TRANSACTIONS


CESN: CEDA: CEMT:

CICS Execute Sign ON CICS Execute Definition and Administration CICS Execute Master Terminal

CECI:
CEDF:

CICS Execute Command Interpreter


CICS Execute Debug Facility

CMAC:
CESF:

CICS Messages for Abend Codes


CICS Execute Sign OfF

CICS Nucleus Control Tables


TCT PCT PPT FCT TST DCT SIT

(Terminal Control Table) (Program Control Table) (Processing Program Table) (File Control Table) (Temporary Storage Table) (Destination Control Table) (System Initialization Table)

Terminal Control Table

Contains

information that describes the configuration of all the terminals and other CICS systems with which terminals can communicate.

Program Control Table

Contains the list of all transactions that may be processed by the system. Includes details such as transaction- id, priority,

security and processing programs name.

Processing Program Table

Contains the list of all programs that may be executed by the system. Include details such as program name, source language

and residency.

File Control Table

Contains the list of all characteristics of logical

files defined within the system.

Temporary Storage Table

Contains the list of all recoverable TSQs

created and programmers.

modified

by

various

Destination Control Table

Contains the list of all TDQs

CICS Nucleus Control Programs


TCP KCP PCP FCP TSP SCP SIP

(Terminal Control Program) (Task Control Program) (Program Control Program) (File Control Program) (Temporary Storage Program) (Storage Control Program) (System Initialization Program)

Terminal Control Program

Receives messages from terminals

Transfers data between terminals and programs

Handles hardware communication requirements

Requests CICS to initiate tasks

Task Control Program

Controls simultaneous execution of tasks and its related properties


Handles all issues related to multi-tasking

Program Control Program

Locates and loads programs for execution Transfers control between programs Returns control to CICS

File Control Program

Provides application programs with services to read,

update, add and delete records in a file.


Manages exclusive control over the records in order to

maintain data integrity during record updates.

Storage Control Program

Controls allocation and de-allocation of storage within

CICS region

CICS Hello World! Program Development


Step 4: Compile the program using the clist TRNGCICS

TO ERASE THE DATA ON TERMINAL

CICS COMMANDS

EXEC CICS SEND CONTROL ERASE END-EXEC


PLACING THE CURSOR ON A PARTICULAR POSITION

EXEC CICS SEND CONTROL CURSOR(POS) END-EXEC

SEND DATA TO THE TERMINAL

CICS COMMANDS

EXEC CICS SEND FROM(VAR) END-EXEC


RECEIVING DATA FROM THE TERMINAL

EXEC CICS RECEIVE INTO(VAR) END-EXEC

TO END THE TRANSACTION

CICS COMMANDS

EXEC CICS RETURN END-EXEC


TO END THE TRANSACTION AND TO INITIATE ANOTHER

TRANSACTION

EXEC CICS RETURN TRANSID(<TRANSID>) END-EXEC

CICS COMMANDS
TO END THE TRANSACTION AND TO INITIATE

ANOTHER TRANSACTION EXEC CICS RETURN TRANSID(<TRANSID>) END-EXEC

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>

EXECUTION INTERFACE BLOCK


EIBCALEN: contains the length of the data that is

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:

Map and mapset name: 1 to 8 columns


Macro : Follwed by map or map name or field name

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

: GENERATES ONLY SYMBOLIC MAP


: GENERATES BOTH : TO END THE MAPSET

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.

SEND MAP TO THE TERMINAL

EXEC CICS

SEND MAP(MAPNAME) MAPSET(MAPSET NAME) ERASE END-EXEC.

RECEIVE MAP FROM THE TERMINAL

EXEC CICS

RECEIVE MAP(MAPNAME) MAPSET(MAPSET NAME) END-EXEC.

TRANSFER OF CONTROL

XCTL LINK

XCTL
USED TO TRANSFER THE CONTROL FROM ONE PROGRAM TO

ANOTHER PROGRAM
SYNTAX

EXEC CICS XCTL PROGRAM(PROGRAM NAME) END-EXEC.

COMMAREA(VAR)

THE CONTROL WILL BE TRANSFERRED FROM ONE PROGRAM TO

ANOTHER PROGRAM WHICH IS AT SAME LOGICAL LEVEL


THE CONTROL WILL NOT BE RETURNED TO MAIN PROGRAM

LINK
USED TO TRANSFER THE CONTROL FROM ONE PROGRAM

TO ANOTHER PROGRAM

SYNTAX

EXEC CICS LINK PROGRAM(PROGRAM NAME) COMMAREA(VAR) END-EXEC.


THE CONTROL WILL BE TRANSFERRED FROM ONE

PROGRAM TO ANOTHER PROGRAM WHICH IS AT LOWER LOGICAL LEVEL

THE CONTROL WILL BE RETURNED TO MAIN PROGRAM

DFHAID
IT IS A PREDEFINED COPY MEMBER THAT CAN COPIED

IN APPLICATION PROGRAM TO MAKE USE OF FUNCTIONAL KEYS

PSEUDO CONVERSATION
MULTIPLE TRANSACTIONS AND MULTIPLE PROGRAMS

MULTIPLE TRANSACTIONS AND SINGLE PROGRAM

SINGLE PROGRAM AND SINGLE TRANSACTION

MULTIPLE TRANSACTIONS AND MULTIPLE IDENTIFIERS


A SINGLE APPLICATION CAN BE DIVIDED INTO DIFFERENT

PROGRAMS .

EACH AND EVERY PROGRAM WILL BE GIVEN ONE

TRANSACTION-ID.

THE TERMINATION OF ONE PROGRAM INITIATES THE

EXECUTION OF ANOTHER TRANSACTION THROUGH RETURN TRANSID(trans id) Ex: EXEC CICS RETURN TRANSID(T166) COMMAREA(VAR) END-EXEC.

MULTIPLE TRANSACTIONS AND SINGLE PROGRAM


A SINGLE PROGRAM IS DEVELOPED WITH MULTIPLE PARAGRAPHS. THE PROGRAM WILL BE DEFINED WITH MULTIPLE TRANSACTIONS DEPENDING ON THE TRANSACTION THAT IS GIVEN ON THE TERMINAL

THE CORRESPONDING PARAGRAPH WILL BE EXECUTED

MULTIPLE TRANSACTIONS AND SINGLE PROGRAM

EX:

EX: PROCEDURE DIVISION EVALUATE EIBTRNID WHEN T1 PERFORM ADD-PARA WHEN T2 PERFORM SUB-PARA WHEN T3 PERFORM MUL-PARA

DEFINING MULTIPLE TRANSACTIONS FOR PROGRAM TCHPG167

CEDA DEF TRANS(T1) PROG(TCHPG167)

CEDA DEF TRANS(T2) PROG(TCHPG167)

CEDA DEF TRANS(T3) PROG(TCHPG167)

END-EVALUATE. ADD-PARA. -----------SUB-PARA.

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

SINGLE PROGRAM AND SINGLE TRANSACTION


A SINGLE PROGRAM WILL HAVE ONLY ONE TRANSACTION THE TRANSACTION WILL BE ENDED ONCE THE MAP IS SENT

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:

HANDLE CONDITION Syntax:

EXCEPTION HANDLING

EXEC CICS HANDLE CONITION <exception condition name1> <exception condition name2> END-EXEC.

(<para name>) (<para name2>)

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

the command in which NOHANDLE is coded


Ex: EXEC CICS SEND MAP(mapname) MAPSET(mapsetname) NOHANDLE END-EXEC.
All the exception conditions that occurs in the above

command will be ignored and the control passes to next command

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

and DELETE the records from file


File should be defined to cics region before it is being used

by online application.
File will be closed and opened explicitely in the CICS region

FILES
Defining file to CICS region

CEDA DEF FILE(pseudo name)


Entering above comand will prompt us to enter exact file name and the type of

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

CEMT SET FILE(PSEUDO NAME) EX:

FILES
READ COMMAND
EXEC CICS

READ FILE(file name) INTO(var) RIDFLD(var) RESP(var)

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

WRITE FILE(file name) FROM(var) RIDFLD(var) RESP(var)

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

DELETE FILE(file name) RIDFLD(var) RESP(var) END-EXEC.

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)

COMMAND FOR STARTING BROWSE

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

EXEC CICS READNEXT FILE(file name) INTO(VAR) RESP(VAR) RIDFLD(var) 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.

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

of there entry and will be deleted once the record is read


The data is transient in TDQ

TDQ must be defined in DCT(Destination Control Table)

with the queue id.


The TDQ ID can have maximum of 4 characters

TDQ
Operations on TDQ
Write: Records will be written in the order of there entry
Read: Records can only be read sequentially.

once the records is read it will be deleted


Delete: The TDQ can be deleted

Note: updating a record is not possible

TDQ
Types of TDQ
INTRA PARTITION TDQ EXTRA PARTITION TDQ

INTRA PARTITION TDQ


These will be maintained by the transactions of same or

different CICS regions


These can be used to pass the data from one CICS program to

another CICS program


Defining INTRAPARTITION TDQ
CEDA DEF TDQ(queue name) Type : INTRA / EXTRA

EXTRA PARTITION TDQ

These will be maintained by the transactions of CICS and

BATCH jobs

These can be used to pass the data from one CICS program to

another BATCH program

EXTRA PARTITION TDQ


Defining EXTRA PARTITION TDQ
CEDA DEF TDQ(queue name) Type : INTRA / EXTRA

Ex: CEDA DEF TDQ(Q1) TYPE : EXTRA EXTRA PARTITION TDQ PARAMETERS TYPE : INPUT/OUTPUT FILE NAME : TCHN167.TSO.PS

EXTRA PARTITION TDQ


If EXTRA PARTITION TDQ is INPUT type:
only read operations can be done the queue by CICS

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

EXTRA PARTITION TDQ


If EXTRA PARTITION TDQ is OUTPUT type:
only WRITE operations can be done the queue by 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

-> TDQ -> online prosess(write)

Batch process -> (read) PS

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:

Queue name mentioned in QUEUE option must be defined in CICS region

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:

Queue name mentioned in QUEUE option must be defined in CICS region

TDQ commands
DELETE
EXEC CICS DELETEQ TD QUEUE(queue name) RESP(err) END-EXEC.

NOTE:

Queue name mentioned in QUEUE option must be defined in CICS region

Applications Intra TDQ


Interface among CICS txns

Appl pgm 1 TDQ Appl pgm2 Report

Automatic Task Initiation (ATI ) Message Routing

Applications Extra TDQ


Interface to batch jobs

CICS Appl pgm TDQ File Batch Pgm

Interface from batch jobs

Batch Pgm File TDQ CICS Appl pgm

Automatic Task Initiation ATI


ATI is a faciliy through which a CICS txn can be

intiated automatically. No of records in an Intra TDQ triggers the txn initiation.

FHDCT

TYPE=INTRA,
DESTID=MSGS TRANSID = MSW1 TRIGLEV = 1000

Applications Message Switching, Report Printing

Temporary Storage Queue


TSQ is idetified by Queue Id
TSQ could be accessed by any of the following txns

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.

Qid naming convention

TSQ continue...
Read ReadQ (direct read ) ReadQ ( Seq read )

Write writeQ with rewrite option

You might also like