CICS

1

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

2

CICS

3

Introduction to CICS

CICS 4 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 .Single command can replace series of macros .high level lang.version commands to request CICS services .

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

Prg Files & Database .CICS 6 CICS & Operating System Operating System CICS Enter Code : User¶s App.

CICS 7 DB/DC System Terminals Data Base Central System .

CICS 8 CICS System Services ‡ ‡ ‡ ‡ ‡ Data-Communication Functions Data-Handling Functions Application Program Services System Services Monitoring Functions .

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.CICS 9 Task &Transaction ‡ Task :. transaction is identified by the transaction identifier (Trans-id) .

CICS Application Programming Concepts 10 ‡ Pseudo-Conversational ‡ Multitasking ‡ Multithreading ‡ Quasi-Reentrancy .

CICS 11 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 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 . a significant amount of resource will be wasted just waiting ‡ Pseudo-Conversational.

CICS Conversational Transaction Example 12 PROCEDURE DIVISION.... : process .12345 END-EXEC..<= User Enters Data END-EXEC..<= EMP(12345) Details END-EXEC. EXEC CICS RECEIVE ----. EXEC CICS RECEIVE ---.. : FIRST-PROCESS.SECOND PROCESS.. * ..<= TSK1. : process EXEC CICS SEND ----.Program Waits For Response .

CICS Pseudo-Conversational Example Transaction TSK2 Program PROG2 PROCEDURE DIVISION. 13 Transaction TSK1 Program PROG1 PROCEDURE DIVISION. EXEC CICS RETURN END-EXEC. : EXEC CICS RECEIVE END-EXEC. : EXEC CICS RECEIVE END-EXEC. : EXEC CICS SEND END-EXEC. : EXEC CICS SEND END-EXEC. . EXEC CICS RETURN TRANSID (µTSK2¶) END-EXEC.

CICS

14

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
‡ Tables
PCP FCP TCP KCP TSP TDP SCP ICP JCP Processing Progm Table File Control Table Terminal Control Table Program Control Table Temp. Storage Table Destin. Control Table PPT FCT TCT PCT TST DCT

15

‡ Programs
Program Control File control Terminal Control Task Control Temporary Storage Transient Data Storage Control Interval Control Journal Control

CICS

16

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

OPEN. READ & WRITE statements are not permitted because file management is handled by CICS. . .FILE SECTION. (STOP RUN & GOBACK are sometimes included in order to eliminate compiler diagnostic but never executed) .COBOL commands such as ACCEPT. SECTION. DISPLAY.No CONFIG. GOBACK are avoided. STOP RUN. I/O SECTION to be specified in the ENVIRONMENT DIVISION.CICS 17 CICS Program Restrictions ‡ Restrictions . CLOSE.

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

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

CICS 20 Basic Mapping Support .

CICS 21 Topics in BMS ‡ ‡ ‡ ‡ ‡ ‡ ‡ Introduction to BMS Physical and Symbolic Map Map and Mapset Map Definition Macros Screen Manipulation/Handling Screen Design Considerations Interfacing with Terminal using a Map .

) Construct NMDS . BMS macros are available for Map coding.Native Mode Data Stream Text handling Terminal Paging & Message routing Contents of the screen defined thru¶ BMS is called Map. Titles... Map is a program written in assembly language.CICS 22 Introduction to BMS ‡ Primary functions of BMS ‡ Removal of device dependent codes from Application Program ‡ Removal of constant information from Application program ‡ ‡ ‡ ‡ ‡ ‡ (Headers. .

makes up a Mapset (load module). Pgm. ‡ Generic name 1. Mapset must have a entry in PPT Mapset name has two parts. To identify the device type Multimap Panel Dynamically constructing a screen panel with multiple maps at the execution time . Used in App. linkedited together.7 chars. One or more maps. ‡ Suffix 1 char.CICS 23 Map and Mapset ‡ Representation of one screen format is called Map ‡ ‡ ‡ ‡ ‡ (screen panel).

CICS 24 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 prog Symbolic Map is a map used by Application Program (DSECT) .

PIC X(21). 02 EMPNAF 02 FILLER REDEFINES EMPNAF. 02 EMPNAI 01 EMPRECO REDEFINES EMPRECI. 02 EMPNAL PIC S9(4) COMP. PIC X. 02 FILLER PIC X(12). 02 FILLER PIC X(03).CICS 25 Example Of Symbolic Map 01 EMPRECI. . 02 EMPNAO PIC X(21). 03 EMPNAA PIC X. 02 FILLER PIC X(12).

Logic Flow BMS source Assembler Physical MAP Symbolic MAP Linkage editor Load module (MVS) .CICS 26 Physical & Symbolic Map .

STORAGE=AUTO. X X X X * * ANY COMMENTS . TIOAPFX=YES 72 contd. MODE=INOUT.CICS 27 Map definition Macros General Format 1 setname operation Example EMPMAP DFHMSD 16 operands TYPE=MAP. LANG=COBOL.

CICS 28 Order of Macros ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ DFHMSD TYPE=DSECT DFHMDI Map DFHMDF A field DFHMDF A field : DFHMDI Map DFHMDF A field DFHMDF A field : DFHMSD TYPE=FINAL END Mapset Mapset .

PRINT) X X X X X . Example EMPMSET DFHMSD TYPE=&SYSPARM .FRSET.CICS 29 DFHMSD Macro ‡ Define a mapset and its characteristics or to end a mapset ‡ ‡ definition Only one mapset is allowed in one assembly run. LANG=COBOL. CNTL=(FREEKB. MODE=INOUT. TIOAPFX=YES. STORAGE=AUTO.

CICS 30 DFHMDI Macro ‡ Define a map and its characteristics ‡ Example EMPMAP DFHMDI SIZE=(ll. JUSTIFY=LEFT/RIGHT X X X . LINE=nn.cc). COLUMN=mm.

CICS 31 Screen Layout &Customer No. :&nnnnnnnn ‡ Where & Attribute character n Unprotected numeric .Cursor .

:¶. LENGTH=8 X X X X X X X X . PICOUT=µ9(8)¶. ATTRB=ASKIP. INITIAL=µCustomer No. JUSTIFY=RIGHT. LENGTH=14 CUSTNO DFHMDF POS=(ll.FSET.cc).IC). PICIN=µ9(8)¶. ATTRB=(UNPROT.CICS DFHMDF Macro For The Above Layout 32 ‡ Define a field and its characteristics ‡ Example DFHMDF POS(ll.NUM.cc).

of DFHMDF.Keyboard Attributes .Attribute Related to the Field Modification .CICS 33 Attribute character ‡ Invisible one byte character ‡ Defines the characteristics of a field Thru¶ ATTRB param. ‡ There are different kinds of attributes .Cursor Control Attribute .Attributes to control the display intensity of the field .

CNTL=FRSET. defined in map/mapset . ‡ MDT setting/resetting .FSET in ATTRB parameter of DFHMDF .when the user modifies a field on the screen .CICS 34 Modified Data Tag ‡ Indicates the field has been modified or not ‡ Effective use of MDT reduces the amount of data traffic.

CICS 35 Skipper Technique ‡ Unlabelled 1-byte field with the autoskip attribute ‡ DFHMDF POS(ll.LENGTH=1 ‡ To skip the cursor to the next unprotected field after one ‡ unprotected field. Screen Layout : &xxxxx&$ &xx where $ & X Skipper field Attribute byte Unprotected field .ATTRB=ASKIP.cc).

Screen Layout : &xxxxx&$#&$ where # Stopper field .CICS 36 Stopper Technique ‡ Unlabelled 1-byte field with the protect attribute ‡ DFHMDF POS(ll.LENGTH=1 ‡ To stop the cursor in order to prevent erroneous field ‡ overflow by terminal user.ATTRB=PROT.cc).

pgm) ‡ Checking Cursor Position by EIBCPOSN. .pgm) ‡ Dynamic/Relative Positioning (app.CICS 37 Cursor Positioning Techniques ‡ Static positioning (map definition) ‡ Dynamic/Symbolic Positioning (app.

PA keys.CICS 38 AID KEYS ‡ Indicates the method to initiate the transfer of info. PF keys. from ‡ ‡ ‡ ‡ ‡ terminal to CICS. ENTER & CLEAR key EIBAID contains .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 . recently used AID code Standard AID list .

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. PICOUT parameter has to be given in the field definition macro.CICS Numeric Sign/Decimal Pt Handling 39 ‡ Numeric Sign : For input operations. . Virtual decimal point or Separate fields approach can be used and for output operations.

‡ Syntax : EXEC CICS SEND MAP(mapname) [[ FROM(dataname) ] [DATAONLY] | MAPONLY] [ MAPSET(mapsetname) ] [ CURSOR(VALUE) ] [ FREEKB ][ ERASE ][ FRSET ] [ HANDLE | NOHANDLE [ RESP (dataname) ] ] END-EXEC Conditions : INVREQ.LENGERR .CICS 40 SEND MAP ‡ Writes formatted output to a terminal.

CICS 41 RECEIVE MAP ‡ To receive input from a terminal ‡ Syntax : EXEC CICS RECEIVE MAP (mapname) [ SET(pointer) | INTO(dataname) ] [LENGTH(msg-len)] [ MAPSET(mapsetname) ] [ HANDLE | NOHANDLE [ RESP() ] ] END-EXEC Conditions: INVREQ. MAPFAIL .

CICS 42 Types of BMS Panel operations ‡ ‡ ‡ ‡ ‡ Single Map panel Text Panel Multipage Message Multimap Panel Multimap/Multipage Message .

CICS 43 Screen Design Considerations ‡ Functional Screen Design ‡ User-Friendly Screen Design .

CICS CICS Transaction (Initiation) Flow :Operating System System Services 44 Program Library ACCT Terminal Control 2 3 Account File 1 Storage Manage -ment .

CICS CICS Transaction Flow :-( SEND MAP) Operating System Program Library 45 Menu Screen File Control Account File Program ACCT00 BMS .

CICS 46 CICS Transaction Flow :( RECEIVE & SEND MAPs) Operating System User¶s Next input File Control Account File Program Library 6 8 BMS Program ACCT01 7 .

CICS

47

PROGRAM CONTROL

CICS

48

Program Control Commands
‡ ‡ ‡ ‡ ‡
LINK XCTL RETURN LOAD RELEASE

CICS

49

LINK
‡ Used to pass control from one application program to ‡ ‡ ‡
another The calling program expects control to be returned to it Data can be passed to the called program using COMMAREA If the called program is not already in main storage it is loaded

CICS

50

LINK Syntax
EXEC CICS LINK PROGRAM(name) [COMMAREA(data-area) [LENGTH(data-value)]] END-EXEC. Conditions : PGMIDERR, NOTAUTH, LENGERR

CICS 51 XCTL ‡ To xfer 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 .

LENGERR . Conditions : PGMIDERR. NOTAUTH.CICS 52 XCTL Syntax EXEC CICS XCTL PROGRAM(name) [COMMAREA(data-area) [LENGTH(data-value)]] END-EXEC.

CICS 53 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 .

Conditions : INVREQ. LENGERR .CICS 54 RETURN Syntax EXEC CICS RETURN [TRANSID(name) [COMMAREA(data-area) [LENGTH(data-value)]]] END-EXEC.

CICS 55 CICS PROG A LINK RETURN PROG C LINK RETURN Level 0 Level 1 PROG B XCTL Level 2 Level 3 Application Program Logic Levels PROG D XCTL PROG E RETURN .

PGMIDERR .CICS 56 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. Condition : NOTAUTH.

Conditions : PGMIDERR. NOTAUTH.CICS 57 RELEASE ‡ To RELEASE a loaded program/table/map ‡ Syntax : EXEC CICS RELEASE PROGRAM(name) END-EXEC. INVREQ .

Working Storage defn Called program .Linkage section defn under DFHCOMMAREA Called program can alter data and this will automatically available in calling program after the RETURN command ( need not use COMMAREA option in the return for this purpose ) EIBCALEN is set when COMMAREA is passed ‡ .CICS 58 COMMAREA ‡ Data passed to called program using COMMAREA in ‡ ‡ ‡ LINK and XCTL Calling program .

Conditions caused by user errors and input data errors. Errors caused by mismatches bet. . pgm. Conditions caused by omissions or errors in the application code.CICS 59 POSSIBLE ERRORS ‡ Conditions that aren't normal from CICS's point of view ‡ ‡ ‡ ‡ but that are expected in the pgm. applications and CICS tables. generation parameters & JCL Errors related to hardware or other system conditions beyond the control of an appl.

This state occurs µcause of NO HANDLE /RESP/IGNORE conditions ‡ Pass control to a specified label . following the command that has failed to execute.System will terminate or suspend the task depends on the exceptional condition occurred .CICS Error Handling Methods 60 When the error (exceptional conditions) occur.Control goes to a label in the program defined earlier by a HANDLE CONDITION command. A return code is set in EIBRESP and EIBRCODE. the program can do any of the following ‡ Take no action & let the program continue . ‡ Rely on the system default action .Control returns to the next inst.

all the other ERRORs together.CICS 61 HANDLE CONDITION ‡ HANDLE CONDITION condition[(label)]. and 'label' specifies the location within the program to be branched Remains active while the program is executing or until it encounters IGNORE/another HANDLE cond. 'condition' ‡ ‡ specifies the name of the condition.. LENGERR will be handled by system . separately.. Syntax : EXEC CICS HANDLE CONDITION ERROR(ERRHANDL) LENGERR(LENGRTN) END-EXEC This example handles DUPREC cond.

CICS 62 Alternative to HANDLE Condition ‡ NOHANDLE to specify ³no action to be taken for any condition or attention identifier (AID) ³ ‡ RESP(xxx) "xxx" is a user-defined fullword binary data area. Later. it contains a return code.. .. or If xxx=DFHRESP(NORMAL) . it can be tested by means of DFHRESP as follows. If xxx=DFHRESP(NOSPACE) . On return from the command...

‡ µcondition¶ specifies the name of the condition that is to be ‡ ignored( no action will be taken) 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 ...CICS 63 IGNORE CONDITION ‡ IGNORE CONDITION condition condition .

IGNORE CONDITION. a sub-program can suspend Handle commands of the called program using PUSH HANDLE ‡ While returning the control. it can restore the Handle command using POP HANDLE . HANDLE AID and HANDLE ABEND commands.CICS 64 PUSH & POP ‡ To suspend all current HANDLE CONDITION. while calling sub-pgms (CALL) ‡ While receiving the control. ‡ Used for eg.

CICS 65 Syntax of Push & Pop ‡ Syntax of Push : EXEC CICS Push Handle END-EXEC. . ‡ Syntax of Pop : EXEC CICS Pop Handle END-EXEC.

Id (1 Byte) EIBCALEN Length of DFHCOMMAREA (S9(4) comp) EIBDATE Date when this task started (S9(7) comp-3) EIBFN Function Code of the last command ( 2 Bytes) EIBRCODE Response Code of the last command (6 Bytes) EIBTASKN Task number of this task (S9(7) comp-3) EIBTIME Time when this task started (S9(7) comp-3) EIBTRMID Terminal-Id (1 to 4 chars) EIBTRNID Transaction-Id (1 to 4 chars) .CICS 66 EXEC Interface Block (EIB) ‡ CICS provides some system-related information to each ‡ task as EXEC Interface Block (EIB) unique to the CICS command level EIBAID Attention.

CICS

67

Processing Program Table - PPT
DFHPPT TYPE=ENTRY PROGRAM |MAPSET= name [PGMLANG= ASM|COBOL|PLI] [RES= NO|FIX|YES] : : other options : Eg. DFHPPT TYPE=ENTRY,PROGRAM=TEST, PGMLANG=COBOL

CICS

68

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

CICS

69

File Handling

CICS 70 VSAM Different types of VSAM Datasets used in CICS are : ‡ ESDS ‡ KSDS ‡ RRDS Entry Sequenced Dataset Key Sequenced Dataset Relative Record Dataset .

(Record Level Locking). Data Independence. CICS Provides Exclusive Control. ‡ In Addition. Opening and closing Files. Deleting an Existing Record. Journalling.CICS 71 Services Provided By CICS ‡ Basic Operations required for a file are Adding a Record. . Modifying an Existing Record. Browsing One or Selected or All Records.

etc. ‡ Re-indexing. Files can be created using IDCAMS Utility.CICS 72 Defining Files ‡ In CICS. should be done using IDCAMS Only. Creating new indexes. . Files Cannot be Created.

) Defining Files can be done either by CEDA Transaction or DFHFCT Macro. . (like ‡ dataset name.CICS 73 Defining A File to CICS ‡ Files should be defined in FCT (File Control Table). etc. access methods. ‡ FCT will contain all the Information about a File. permissible file service request.

SERVRQ=(ADD. DATASETNAME=NAME.ACCMETH=VSAM.DELETE.UPDATE).OPENED) . FILSTAT=(ENABLED.BROWSE.READ.CICS 74 Syntax of DFHFCT Macro DFHFCT TYPE=FILE.

‡ Records can be written in any order. ‡ Program should not open or close a File. . Records can be inserted. A number of records ‡ can be added at a time.CICS 75 File Handling in Programs ‡ Files should not be defined in the Program. updated or deleted.

RIDFLD :. RESP :.Name in the FCT.Contains the return code of the executed command. .CICS 76 Important Key-Words ‡ Dataset/File :.Length of the Record to be Retrieved or Written.Working-Storage Area ‡ ‡ ‡ defined in the program where the CICS Puts/Gets the Data.Contains the Record Key. ‡ Into/From (WS-Rec) :. LENGTH :.

. Condition: DISABLED. IOERR. LENGERR. DUPKEY.CICS 77 Random READ EXEC CICS READ File(filename) [SEt() | Into()] RIdfld(Rec-Key) END-EXEC. NOTFND. NOTOPEN.

.CICS 78 Example for Random Read EXEC CICS READ File( 'INVMAS ') Into(WS-INVMAS-REC) Length(WS-INVMAS-LEN) RIdfld('7135950602') | RIdfld(WSINVMAS-KEY) END-EXEC.

End the Browse Operation at last. Records cannot be Updated. .CICS 79 Sequential Read ‡ Sequential Read is done by Browse Oper. ‡ Establish the pointer to the First Record to be Read ‡ ‡ ‡ ‡ Using StartBr. During Browse Operation. Next and Previous Records can be Read as required Using ReadNext and ReadPrev. Browse can be re-positioned.

NOTFND. Condition : DISABLED.CICS 80 Syntax for STARTBR EXEC CICS STARTBR FILE(filename) RIDFLD(data-area) END-EXEC. . IOERR. NOTOPEN.

. The first READNEXT or READPREV will read the Record where the STARTBR has positioned the File Pointer.CICS 81 Reading the Record after STARTBR ‡ Sequentially the Next or Previous Record can be read ‡ by a READNEXT or READPREV.

NOTFND. . Condition : DUPKEY. LENGERR. IOERR. ENDFILE.CICS 82 Syntax of READNext/READPrev EXEC CICS READNext | READPrev FILE(name) INTO(data-area)|SET(ptr-ref) RIDFLD(data-area) END-EXEC.

Condition: INVREQ .CICS 83 ENDBRowse ‡ ENDBRowse terminates a Previously issued STARTBR. ‡ SYNTAX :EXEC CICS ENDBR FILE(filename) END-EXEC.

. Condition: IOERR.CICS 84 RESETBR ‡ Its effect is the same as ENDBR and then giving ‡ another STARTBR. Syntax : EXEC CICS RESETBR FILE(filename) RIDFLD(data-area) END-EXEC. NOTFND.

RIDFLD is not used but after write ‡ ‡ execution. For KSDS. RBA value is returned and Record will be written at the end of the File. ‡ For ESDS. RIDFLD should be the Record Key. MASSINSERTion must be done in ascending order of the Key. The record will be written depending on the Key.CICS 85 WRITE Command ‡ Adds a new record into the File. .

NOSPACE. Condition: DISABLED.CICS 86 Syntax for WRITE EXEC CICS WRITE FILE(filename) FROM(data-area) RIDFLD(data-area) END-EXEC. NOTOPEN. IOERR. DUPREC. LENGERR. .

‡ REWRITE automatically UNLOCKs the Record after execution. .CICS 87 REWRITE Command ‡ Updates a Record which is Previously Read with UPDATE Option.

NOSPACE. LENGERR.CICS 88 Syntax for REWRITE EXEC CICS REWRITE FILE(filename) FROM(data-area) END-EXEC. . IOERR. Condition: DUPREC.

‡ Record can be deleted in two ways. and the record read with READ with UPDATE will be deleted. RIDFLD with the full key in it.CICS 89 DELETE Command ‡ Deletes a Record from a dataset. ‡ Multiple Records Delete is possible using Generic Option. .

CICS 90 Syntax of DELETE EXEC CICS DELETE FILE(filename) RIDFLD(data-area) END-EXEC. IOERR. NOTOPEN. . DUPKEY. NOTFND. Optional Condition: DISABLED.

Condition: DISABLED. . NOTOPEN.CICS 91 UNLOCK ‡ To Release the Record which has been locked by READ ‡ with UPDATE Command. Syntax : EXEC CICS UNLOCK FILE(filename) : [other options] END-EXEC. IOERR.

INVREQ In Addition to the above. . FILENOTFOUND. SYSIDERR.CICS 92 General Exceptions ‡ The following Exceptions usually will occur for ALL CICS File Handling Commands. NOTAUTH. Exceptions shown along the systax will occur.

CICS 93 Communication With Databases .

CICS 94 CICS . EXEC SQL function [options] END-EXEC .DB2 ‡ CICS provides interface to DB2. ‡ DB2 requires ³CICS Attachment Facility´ to connect ‡ itself to CICS CICS programs can issue commands for SQL services in order to access the DB2 database.

Pgm..CICS 95 Operating system CICS REGION DB2 REGION CICS Attachment Facility App. EXEC SQL. DB2 Database DB2 Database access by CICS .

The RCT must be link-edited into a library that is accessible to MVS .CICS 96 RCT Entry ‡ The CICS-to-DB2 connection is defined by creating and ‡ ‡ ‡ assembling the resource control table (RCT) The information in RCT is used to control the interactions between CICS & DB2 resources DB2 attachment facility provides a macro (DSNCRCT) to generate the RCT.

..) DB2 Precompiler | CICS command translator | Compile By COBOL | Linkedit by Linkage editor | Load Module 97 .CICS DB2 .Precompiler Source Program (EXEC SQL. | EXEC CICS...

CICS 98 QUEUES .

CICS 99 Transient data Control ‡ Provides application programmer with a queuing facility ‡ Data can be stored/queued for subsequent internal or ‡ ‡ ‡ external processing Stored data can be routed to symbolic destinations TDQs require a DCT entry Identified by Destination id .1 to 4 bytes .

CICS 100 TDQs ‡ Intra-partitioned .ATI (Automatic Task Inititation ) associated with trigger level .Create files for subsequent processing by Non-CICS / Batch programs . Can associate with any sequential device .association within the same CICS subsystem Typical uses are . transaction error messages .Broadcasting etc ‡ Extra-partitioned .association external to the CICS subsystem. DASD.Tape.Message switching . Printer etc Typical uses are . statistics.Logging data.

CICS 101 TDQs ‡ Operations Write data to a transient data queue (WRITEQ TD) Read data from a transient data queue (READQ TD) Delete an intrapartition transient data queue (DELETEQ TD). .

INVREQ. LENGERR. IOERR. QIDERR. Conditions: DISABLED. NOSPACE.CICS 102 WRITEQ TD ‡ Syntax : EXEC CICS WRITEQ TD QUEUE(name) FROM(data-area) [LENGTH(data-value)] [SYSID(systemname)] END-EXEC. NOTAUTH. NOTOPEN. SYSIDERR . ISCINVREQ.

INVREQ. QZERO. QBUSY. QIDERR.Data record not available in the queue after the read. SYSIDERR . NOTOPEN.CICS 103 READQ TD ‡ Reads the queue destructively . IOERR. NOTAUTH. ‡ Syntax : EXEC CICS READQ TD QUEUE(name) {INTO(data-area) | SET(ptr-ref) } [LENGTH(data-value)] [NOSUSPEND] END-EXEC. ISCINVREQ. LENGERR. Conditions : DISABLED.

SYSIDERR . ISCINVREQ. Conditions: INVREQ. QIDERR.CICS 104 DELETEQ TD ‡ Deletes all entries in the queue ‡ Syntax : EXEC CICS DELETEQ TD QUEUE(name) END-EXEC. NOTAUTH.

. DFHDCT is a macro to define intra & extra partition TDQs TYPE=INTRA/EXTRA REUSE option specified along with intra partition TDQ tells whether the space used by TDQ record will be removed & reused after it has been read.CICS 105 Destination Control Table ‡ DCT is to register the information of all TDQs ‡ Destination Control Program (DCP) uses DCT to identify ‡ ‡ all TDQs and perform all I/O operations.

CICS 106 Automatic Task Initiation ‡ Facility through which a CICS transaction can be initiated automatically DFHDCT TYPE=INTRA DESTID=MSGS TRANSID=MSW1 TRIGLEV=500 When the number of TDQ records reaches 500. the transaction MSW1 will be initiated automatically ‡ Applications Message switching & Report printing .

Identified by Queue id .Typically a combination of termid/tranid/operid ‡ Each record in TSQ identified by relative position.No CICS table entry required if recovery not required .Created and deleted dynamically .CICS 107 Temporary Storage Control ‡ Provides application programmer the ability to store and ‡ ‡ retrieve data in a TSQ Application can use the TSQ like a scratch pad TSQs are .1 to 8 bytes . called the item number .

Non-recoverable ‡ Auxiliary .CICS 108 TSQs ‡ Operations ‡ Write and Update data ‡ Read data . VSAM file DFHTEMP .Sequential and random ‡ Delete the queue ‡ Access ‡ Across transactions ‡ Across terminals ‡ Storage ‡ Main .Recoverable ‡ TST entry required.

Typical uses ‡ Data passing among transactions ‡ Terminal Paging ‡ Report printing .CICS 109 TSQs .

NOSPACE. ISCINVREQ . Conditions : ITEMERR.CICS 110 WRITEQ TS ‡ Syntax : EXEC CICS WRITEQ TS QUEUE(name) FROM(data-area) [LENGTH(data-value)] [NUMITEMS(data-area) | ITEM(data-area) [REWRITE] ] [MAIN|AUXILIARY] [NOSUSPEND] END-EXEC. NOTAUTH. IOERR. LENGERR. QIDERR. INVREQ. SYSIDERR.

NOTAUTH. QIDERR. ISCINVREQ . LENGERR. Conditions : ITEMERR.CICS 111 READQ TS ‡ Syntax : EXEC CICS READQ TS QUEUE(name) {INTO(data-area) | SET(ptr-ref) } LENGTH(data-value) [NUMITEMS(data-area)] [ITEM(data-area) | NEXT ] END-EXEC. SYSIDERR. INVREQ. IOERR.

NOTAUTH. SYSIDERR . ISCINVREQ. Conditions: INVREQ. QIDERR.CICS 112 DELETEQ TS ‡ Deletes all entries in the queue ‡ Syntax : EXEC CICS DELETEQ TS QUEUE(name) END-EXEC.

CICS 113 INTERVAL AND TASK CONTROL .

CICS 114 ASKTIME ‡ Used to obtain current date and time ‡ Syntax : EXEC CICS ASKTIME[ABSTIME(data-area)] END-EXEC. ‡ EIBDATE and EIBTIME updated with current date and ‡ time ABSTIME returns value of time in packed decimal format .

. [TIME(data-area) [TIMESEP[(data-value)]]] END-EXEC.CICS FORMATTIME EXEC CICS FORMATTIME ABSTIME(data-ref) [YYDDD(data-area)] [YYMMDD(data-area)]... [DATE(data-area) [DATEFORM[(data-area)]]] [DATESEP[(data-value)]] [DAYOFMONTH(data-area)] [MONTHOFYEAR(data-area)] [YEAR(data-area)]... Condition: INVREQ 115 ‡ Syntax : . etc..

INVREQ .CICS 116 DELAY ‡ Used to DELAY the processing of a task ‡ The issuing task is suspended for a specified interval or ‡ Until the specified time Syntax : EXEC CICS DELAY INTERVAL(hhmmss) | TIME(hhmmss) END-EXEC Conditions: EXPIRED.

TRANSIDERR . LENGERR.CICS 117 START ‡ Used to start a transaction at the specified terminal ‡ ‡ and at the specified time or interval Data can be passed to the new transaction Syntax : EXEC CICS START TRANSID(transid) [TERMID(termid) TIME(hhmmss) | INTERVAL(hhmmss) ] END-EXEC Conditions : INVREQ.TERMIDERR.

to wait for an event to occur.to request notification when the specified time ‡ ‡ ‡ ‡ ‡ ‡ has expired.POST and START identified by REQID. SUSPEND . WAIT EVENT .to gain exclusive control over a resource DNQ .CICS Other Interval Control Commands 118 ‡ POST .Used to suspend a task ENQ . DELAY. eg. RETRIEVE .to free the exclusive control from the resource gained by ENQ .Used to retrieve the data passed by the START CANCEL -Used to cancel the Interval Control requests.

CICS 119 Recovery & Restart .

. eliminate the damage done to the online system. ‡ Recovery/Restart facilities are required to minimize or if possible.CICS 120 The Need for Recovery/Restart ‡ The possible failures that can occur outside the CICS system are Communication failures (in online systems) Data set or database failures Application or system program failures Processor failures & Power supply failures. in case of the above failures to maintain the system & data integrity.

CICS 121 RECOVERY ‡ An attempt to come back to where the CICS system or the transaction was when the failure occurred ‡ Recoverable Resources VSAM files Intrapartition TDQ TSQ in the auxiliary storage DATA tables Resource definitions & System definition files .

CICS 122 RESTART ‡ To resume the operation of the CICS system or the transaction when the recovery is completed .

Resource Recovery Using System Log .Extended Recovery Facility (XRF) .Dynamic Transaction Backout .Automatic Transaction Restart .Resource Recovery Using Journal .CICS 123 Facilities for Recovery/Restart ‡ Facilities for CICS Recovery/Restart .System Restart .

CICS automatically recovers all recoverable resources using the info.the work between the two consecutive SYNC points When an ABEND occurs.CICS Dynamic Transaction Backout (DTB) 124 ‡ When the transaction fails. backing out the changes made ‡ by the transaction while the rest of the CICS system continues normally is called DTB CICS automatically writes the µbefore image¶ information of the record into the dynamic log for the duration of one LUW . in dynamic log (Set DTB=YES in PCT) ‡ .

CICS 125 LUW & SYNC point ‡ The period between the start of a particular set of changes ‡ ‡ ‡ and the point at which they are complete is called a logical unit of work. can be done by Syntax : EXEC CICS SYNCPOINT [ROLLBACK] END-EXEC . Intermediate SYNC pt.LUW The end of a logical unit of work is indicated to CICS by a synchronization point (sync pt).

| Task A|---------------------------------------------| SOT EOT-SP |.......-LUW.|.....LUW. .....| Task B|---------------->--------------->--------------| SOT SP SP EOT-SP When the failure occurs.LUW ..CICS 126 LUWs & SYNC pts |..LUW...|.......... changes made within the abending LUW will be backed out.

Set RESTART=YES in PCT Care should be taken in order to restart the task at the point where DTB completes in the case of intermediate SYNC point .CICS 127 Automatic Transaction Restart ‡ CICS capability to automatically restart a transaction after ‡ ‡ all resources are recovered through DTB If the transaction requires automatic restart facility.

the other system will continue The system downtime can be reduced to few minutes if XRF is used .CICS 128 Extended Recovery Facility-XRF ‡ XRF is to increase the availability of CICS by ‡ ‡ ‡ ‡ automating the fast recovery of CICS resources There are two systems with same configuration All the resources are shared by the two systems If the failure occurs in one system.

CICS Communication Controller (3725) ACF/NCP Active Session Back-up Session 129 XRF-Concept 3090 MVS/XA ACF/VTAM CICS/MVS 3090 System Files CICS Files Application Files MVS/XA ACF/VTAM CICS/MVS Active System Shared Resources Alternate system .

CICS 130 Program Preparation .

CICS 131 Introduction ‡ Preparing a Program to run in CICS Environment. . ‡ Executing the Program. ‡ Defining the Program in the CICS Region.

& ‡ Link the Program. ‡ Assemble or Compile the Translator Output.CICS 132 Preparing a Program ‡ CICS requires the following steps to prepare a Program. ‡ Translating the Program. .

CICS 133 Translation ‡ Translates the µEXEC CICS¶ Statements into the ‡ ‡ ‡ Statements your Language (COBOL) Compiler can Understand. a Program Listing as SYSPRINT and a Translated Source in SYSPUNCH. The Translator gives two outputs. The SYSPUNCH is given as the input to the Program Compiler. there should not be any CICS Statements in the Copy Book. If any Copy Books are used in the Program. .

CICS 134 Compiling or Linking ‡ As the CICS Commands have been translated. . Hence. The ‡ Compilation of the CICS Program is the same as Language Program. the Compiler Options can be specified as required.

. This can be done either by using CEDA Trans. or DFHPPT.CICS 135 Defining the Program ‡ The Application should be defined and Installed into the ‡ PPT.

CICS 136 CICS Supplied Transactions .

the Userid given in CESN is verified. the previous operator will be signed off .LANGUAGE=l] Userid & password values can be from 1-8 chars.NEWPS=newpassword][. NEWPS to change the password and LANGUAGE to choose national language Sign off by CESF which breaks the connection between the user and CICS If the Sign on is done twice for the same userid at the terminal. In RACF.PS=password] ‡ ‡ ‡ ‡ ‡ [.CICS 137 CESN/CESF Transactions ‡ To sign on to CICS system ‡ CESN [USERID=userid] [.

Command Level Interpreter 138 ‡ To build and test the effect of EXEC CICS commands ‡ CECI ASSIGN is used to get the current userid. CECI gives the complete command syntax of the specified command. application id etc. Before using the maps in programs..sysid.CICS CECI . CECI READQ TD QUEUE(TESTL001) will read the current record of the given TDQ . it can be tested using CECI to check how it appears on the screen. ‡ ‡ ‡ terminal id.

CICS CEMT-Master Terminal Transaction ‡ ‡ ‡ ‡ Displays the status of CICS & system resources Alter the status of CICS & system resources Remove the installed resource definitions Perform few functions that are not related to resources 139 ‡ CEMT provides the following services .

CICS CEDF-Execution Diagnostic Facility 140 ‡ To test command level application programs interactively ‡ CEDF [termid/sysid/sessionid] [.the identifier of the terminal on which the ‡ ‡ transaction to be tested is being run Sessionid .To test a transaction across an APPC session .To test/monitor a transaction attached across an MRO/ISC session Sysid .OFF] ‡ Termid .ON/.

‡ The points at which EDF interrupts execution of the program and sends a display to the terminal ‡ At transaction initialization.& CEBR can be invoked ‡ ‡ ‡ ‡ ‡ . EIB values can be changed. after EIB has been initialized and before the app.CICS 141 CEDF .. pgm given control Start of execution of each CICS command (auguement values can be changed at this point) End of execution of each CICS command and before the Handle condition mechanism is invoked (response code values can be changed) At program termination & at normal task termination When an ABEND occurs & at abnormal task termination.Contd.

CICS CEBR-Temporary Storage Browse 142 ‡ To browse the contents of CICS temporary storage ‡ ‡ ‡ ‡ ‡ ‡ queues (TSQ) CEBR by default will show the queue associated with the current terminal µCEBRL001¶ which can be overridden to view any other queue TERM to browse TSQ for another terminal QUEUE to make the named queue. current PUT to copy the current queue contents into TDQ GET to fetch TDQ for browsing PURGE erases the contents of the current queue .

II .CICS 143 Screen Definition Facility SDF .

The SDF objects are Panel and Panel Groups (etc.SDF ‡ An interactive tool for defining information to be ‡ ‡ displayed on the screen Objects created by SDF are used by various systems like CICS/BMS.CICS 144 INTRODUCTION .) corresponding to map and mapset in CICS/BMS .. IMS. ISPF etc..

migrate & convert objects Provides functions to develop application prototypes .CICS 145 SDF Functions ‡ Creation of objects which is common for all the systems ‡ Provides functions to alter and test the objects ‡ Generation function to create code for the objects like ‡ ‡ macro codes for CICS/BMS Provides utilities to print.

.g. 146 ‡ SDF has panel commands like µTOP¶ µBOTTOM¶ µUP¶ ‡ ‡ ‡ ‡ ‡ .CICS Panel Commands µDOWN .SHOW.HIDE etc. ATTRIBUTE..alter & view the fields and its attributes E. like to create..EDIT.. to browse through the the panels PRESERVE to protect the panel AUTOSAVE to set the automatic save option on commands µSAVE¶ to record the changes and CANCEL/CCANCEL to quit the changes TEST to test the appearance of the object Commands are available to edit the panels.

move.CICS 147 Panel & Line Commands ‡ SDF has got panel commands to do the following. alter & view the fields and its attributes ‡ And Line commands to copy. ‡ To browse through the panel ‡ To quit/save the changes ‡ To protect the panel and to restore the panel in case or errors ‡ To test the appearance of the panel ‡ Panel editor commands to create. repeat & insert lines . delete.

Variable fields can be defined by variable field marks . Variable fields can be defined by variable field marks.CICS 148 Panels ‡ To create a panel. Enter a existing panel which is to be ‡ ‡ ‡ used as a skeleton for the new panel OR Enter a device type Panel text can be defined by typing the text in the required panel position in format mode. and arrays can be defined by specifying a dimension and direction.

modified data flag.g.justify. field format.cursor position.intensity. E. ‡ To change the panel. ‡ Enter the panel name and library identifier where the panel resides ..CICS 149 Panels Contd. ‡ A panel can be included in another panel with few ‡ restrictions Default attributes are assigned to fields which can be changed.field validation. etc. ‡ color. for attributes are.protection.

BMS characteristics like generation name(later used in generation) & logical device code etc.CICS 150 Panel Groups ‡ A panel group contains information about a group of ‡ ‡ panels.. ‡ E. and the names of the panels that belong to the panel group.g. . Procedure of Creating and editing panel group is same as panel Define the global parameters of the panel group thru¶ µPanel Group Characteristics¶ opt.

CICS 151 Generation ‡ As SDF objects are stored in internal rep. depends on the object type ‡ Panel => Map ‡ Panel group => Mapset One or more data structures(used in Cobol) or control blocks (BMS macros) can be generated . they have to be ‡ ‡ generated to be used in applications Output of generation .

.dgipnl) Only the first two levels can be defined & third level added by sdf depends on the object type ‡ DGIPNL-for panels. DGIGRP-for panel groups and DGIPSTfor partition sets ‡ 'ID' is assigned for each library which is used to search the ‡ objects in the library password can be given to protect the library.CICS 152 SDF Libraries ‡ Define libraries(created in ISPF) to be used by SDF II to ‡ ‡ store and retrieve objects SDF II library is a partitioned data set with a three-level dataset name (project.group.

. map sets & partition sets defined with CICS/BMS macros ‡ Conversion utility :-To convert objects from one target system to a new target system.To print utility produces printouts of panels.To migrate objects from various sources into SDF libraries.partition sets etc. Eg. Maps..CICS 153 SDF utilities ‡ Print :. ‡ Migration:. panel groups.

Simulates the primary interaction between the application & user.the ACTION to be performed & NEXT PANEL to be displayed if certain CONDITIONS are met.CICS 154 Application Prototype ‡ To test the flow of panels. . ‡ Used to validate and determine the initial user requirements before designing the program ‡ Prototype definition ‡ Identify the panel by giving name & library ID ‡ Define the prototype rules based on the CURRENT panel. before they are incorporated into application programs. ‡ Simulative prototype :.

60).NORM).21). * ATTRB=(PROT.NORM) DFHMDF POS=(4.ATTRB=(PROT.FIRST) * * NAME AGE DFHMDF POS=(3.LENGTH=1.LANG=COBOL.LENGTH=3. COLUMN=1. STORAGE=AUTO.SUFFIX=C TULMAP DFHMDI SIZE=(12.NORM) DFHMDF POS=(4.BRT. * ATTRB=(PROT.LENGTH=10. TIOAPFX=YES.LENGTH=6.MODE=INOUT.NORM) DFHMSD TYPE=FINAL .INITIAL='Name:'.21).14).ATTRB=(PROT.CICS Sample Macro 155 TULMAP DFHMSD TYPE=MAP.NORM) DFHMDF POS=(3.25).ATTRB=(UNPROT.ASKIP) DFHMDF POS=(3.JUSTIFY=(LEFT.32).LENGTH=6.INITIAL='Age :'.LENGTH=1. ATTRB=(UNPROT.14).ALARM. DFHMDF POS=(4.DATA=FIELD.CTRL=(FREEKB.FRSET).LINE=1.

CICS 156 Thank You .

Sign up to vote on this title
UsefulNot useful