This action might not be possible to undo. Are you sure you want to continue?
(Customer Information Control System)
Table of Contents Introduction to CICS Basic Mapping Support Program Control File Control Queues Program preparation CICS Supplied Transactions
Introduction to CICS
Customer Information Control System -CICS developed in late 1960s as a DB/DC control system. CICS provides an interface between the Operating System and Application programs. Macro Level CICS - initial version Assembler macro to request CICS services. • Command Level CICS - high level language version - commands to request CICS services - Single command can replace series of macros.
Batch & Online Environment
BATCH SYSTEM 1. Input data is prepared and given in a sequence (file) 2. Processing sequence is predictable and hence restarting the process in case of failure is easy. 3. Programs and files can’t be shared 4. Programs are scheduled through jobs ONLINE SYSTEM 1. Data is entered as needed from the terminal 2. Since processing seq. is unpredictable, special recovery/restart proc. is reqd. in case of failure. 3. Programs and files can be shared 4. Transaction can be run any time
CICS & Operating System DB/DC System CICS System Services
Data-Communication Functions Data-Handling Functions Application Program Services System Services Monitoring Functions
Task:- A basic unit of work which is scheduled by the operating system or CICS
a significant amount of resource will be wasted just waiting. : FIRST-PROCESS.. Since human response is slower than the CPU speed... -Read from and write to the terminal Transaction:.. : Process EXEC CICS SEND ----. : Process Pseudo-Conversational: 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. * .. Application Programming Concepts Pseudo-Conversational Multitasking Multithreading Quasi-Reentrancy 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.Program Waits For Response . EXEC CICS RECEIVE ----.g. 12345 END-EXEC... In CICS.E. transaction is identified by the transaction identifier (Trans-id)..<= TSK1. Conversational Transaction Example PROCEDURE DIVISION.. EXEC CICS RECEIVE ---.An entity which initiates execution of a task.<= User Enters Data END-EXEC.SECOND PROCESS. Pseudo-Conversational Example .<= EMP (12345) Details END-EXEC.
CICS Components Control Programs (or Management Modules) Programs that interface between OS and application program Handles the general functions that are crucial to operation of CICS Program Control File control Terminal Control Task Control Temporary Storage Transient Data Storage Control Interval Control Journal Control PCP FCP TCP KCP TSP TDP SCP ICP JCP Control Tables Define the CICS environment Functionally associated with the management module Processing Program Table File Control Table Terminal Control Table Program Control Table Temp. : EXEC CICS SEND END-EXEC. Storage Table Destin. : EXEC CICS RECEIVE END-EXEC.Transaction TSK1 Program PROG1 PROCEDURE DIVISION. Control Table PPT FCT TCT PCT TST DCT Control Blocks (or Areas) Contain system type information.g. E. Task Control Area contains information about the task . EXEC CICS RETURN TRANSID (‘TSK2’) END-EXEC.
Native Mode Data Stream .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 CICS Program Restrictions Restrictions ... GOBACK are avoided.) Construct NMDS .COBOL commands such as ACCEPT. . TRACE. and non-CICS READ & WRITE statements are not permitted because file management is handled by CICS. Titles.CICS Program Considerations Considerations . SECTION. STOP RUN.Must eventually return control to CICS . OPEN. Basic Mapping Support Introduction to BMS Primary functions of BMS: Removal of device dependent codes from Application Program Removal of constant information from Application program (Headers. .No CONFIG. I/O SECTION to be specified in the ENVIRONMENT DIVISION. DISPLAY. CLOSE. EXHIBIT.FILE SECTION.
Symbolic Map is a map used by Application Program (DSECT) Example Of Symbolic Map 01 EMPRECI. 02 FILLER PIC X(12). Used in App. 02 EMPNAI PIC X(21). 03 EMPNAA PIC X. . Suffix 1 char. 01 EMPRECO REDEFINES EMPRECI. 02 FILLER REDEFINES EMPNAF. Map and Mapset Representation of one screen format is called Map (screen panel). One or more maps. linkedited together. BMS macros are available for Map coding. Types of MAPS There are 2 types of MAPS Physical Map Physical Map is a map used by CICS (CSECT) Ensure device independence in the application program Symbolic Map Ensure device and format independence in the app pgm. Map is a program written in assembly language.Logic Flow Map definition Macros General Format 1 setname operation Example 16 operands 72 contd. Physical & Symbolic Map . Mapset must have a entry in PPT Mapset name has two parts. 02 EMPNAO PIC X(21). pgm.Text handling Terminal Paging & Message routing Contents of the screen defined thru’ BMS is called Map. 02 EMPNAL PIC S9(4) COMP. Generic name 1. 02 FILLER PIC X(12).7 chars. 02 EMPNAF PIC X. makes up a Mapset (load module). To identify the device type Multimap Panel Dynamically constructing a screen panel with multiple maps at the execution time. 02 FILLER PIC X(03).
cc).Cursor DFHMDF X X X . STORAGE=AUTO.PRINT) X X X DFHMDI Macro Define a map and its characteristics Example EMPMAP DFHMDI SIZE=(ll.FRSET. JUSTIFY=LEFT/RIGHT Screen Layout Where & Attribute character n Unprotected numeric . X TIOAPFX=YES. TIOAPFX=YES * ANY COMMENTS TYPE=MAP. X MODE=INOUT. LINE=nn. X X X X Order of Macros DFHMSD TYPE=DSECT Mapset DFHMDI Map DFHMDF A field DFHMDF A field : DFHMDI Map DFHMDF A field DFHMDF A field : DFHMSD TYPE=FINAL Mapset END DFHMSD Macro Define a mapset and its characteristics or to end a mapset definition Example EMPMSET DFHMSD TYPE=&SYSPARM . COLUMN=mm. CNTL=(FREEKB. LANG=COBOL. STORAGE=AUTO. LANG=COBOL.• EMPMAPDFHMSD MODE=INOUT.
ATTRB=ASKIP.CNTL=FRSET. LENGTH=8 X X X X X X X X Attribute character Invisible one byte character Defines the characteristics of a field Thru’ ATTRB parameter of DFHMDF.IC). There are different kinds of attributes . defined in map/mapset .Keyboard Attributes . PICOUT=‘9(8)’.Macro For The Above Layout Define a field and its characteristics Example DFHMDFPOS(ll. INITIAL=‘Customer No.when the user modifies a field on the screen .NUM. Screen Layout : &xxxxx&$ &xx where $ Skipper field & Attribute byte X Unprotected field .FSET.Attributes to control the display intensity of the field .FSET in ATTRB parameter of DFHMDF Skipper Technique Unlabelled 1-byte field with the autoskip attribute DFHMDF POS(ll. ATTRB=ASKIP. PICIN=‘9(8)’.Attribute Related to the Field Modification .LENGTH=1 To skip the cursor to the next unprotected field after one unprotected field. ATTRB=(UNPROT. :’.cc). JUSTIFY=RIGHT.cc).Cursor Control Attribute Modified Data Tag Indicates the field has been modified or not Effective use of MDT reduces the amount of data traffic. LENGTH=14 CUSTNO DFHMDF POS=(ll. MDT setting/resetting .cc).
pgm) Dynamic/Relative Positioning (app.ATTRB=PROT. PA keys. PICOUT parameter has to be given in the field definition macro. PF keys.Stopper Technique Unlabelled 1-byte field with the protect attribute DFHMDF POS(ll. recently used AID code Standard AID list .DFHAID HANDLE AID establish the routines that are to be invoked when the aid is detected by a RECEIVE MAP command Syntax : EXEC CICS HANDLE AID Option (label) END-EXEC Conditions: INVREQ Numeric Sign/Decimal Pt Handling Numeric Sign : For input operations. SEND MAP Writes formatted output to a terminal. ENTER & CLEAR key EIBAID contains. Virtual decimal point or Separate fields approach can be used and for output operations.LENGTH=1 To stop the cursor in order to prevent erroneous field overflow by terminal user. PICOUT parameter can be given in macro Decimal Point : For input operations. pgm) AID KEYS Indicates the method to initiate the transfer of information from terminal to CICS.cc). Syntax : EXEC CICS SEND MAP(mapname) [[ FROM(dataname) ] [DATAONLY] | MAPONLY] [ MAPSET(mapsetname) ] [ CURSOR(VALUE) ] . Screen Layout: &xxxxx&$#&$ where # Stopper field Cursor Positioning Techniques Static positioning (map definition) Dynamic/Symbolic Positioning (app. Separate fields or CR/DR field approach can be used and for output operations.
LENGERR 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.[ FREEKB ][ ERASE ][ FRSET ] [ HANDLE | NOHANDLE [ RESP (dataname) ] ] END-EXEC Conditions : INVREQ. MAPFAIL Types of BMS Panel operations Single Map panel Text Panel Multipage Message Multimap Panel Multimap/Multipage Message Screen Design Considerations Functional Screen Design User-Friendly Screen Design PROGRAM CONTROL Commands LINK XCTL RETURN LOAD RELEASE .
Syntax: EXEC CICS LINK PROGRAM(name) [COMMAREA(data-area) [LENGTH(data-value)]] END-EXEC. The calling program expects control to be returned to it.LINK: Used to pass control from one application program to another. If the called program is not already in main storage it is loaded. Data can be passed to the called program using COMMAREA. . Conditions: PGMIDERR. Conditions: PGMIDERR. Data can be passed using COMMAREA when returning to CICS to the next task Syntax: EXEC CICS RETURN [TRANSID(name) [COMMAREA(data-area) [LENGTH(data-value)]]] END-EXEC. LENGERR RETURN To return control from one application program to another at a higher logical level or to CICS. LENGERR XCTL To transfer control from one application program to another in the same logical level The program from which control is transferred is released Data can be passed to the called program using COMMAREA If the called program is not already in main storage it is loaded Syntax: EXEC CICS XCTL PROGRAM(name) [COMMAREA(data-area) [LENGTH(data-value)]] END-EXEC. NOTAUTH. NOTAUTH.
LENGERR LOAD To load program/table/map from the CICS DFHRPL concatenation library into the main storage Using load reduces system overhead Syntax: EXEC CICS Load Program(name) [SET (pointer-ref)] [LENGTH (data-area)] END-EXEC. PGMIDERR RELEASE To RELEASE a loaded program/table/map Syntax: EXEC CICS RELEASE PROGRAM(name) END-EXEC. Conditions: NOTAUTH. INVREQ COMMAREA Data passed to called program using COMMAREA in LINK and XCTL Calling program .Control returns to the next inst. the program can do any of the following: Take no action & let the program continue . A return code is set in EIBRESP and EIBRCODE.Conditions: INVREQ. following the command that has failed to execute.Control goes to a label in the program defined .Working Storage definition Called program .Linkage section definition under DFHCOMMAREA Called program can alter data and this will automatically be 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 Error Handling Methods When the error (exceptional conditions) occur. This state occurs ‘cause of NO HANDLE /RESP/IGNORE conditions. Pass control to a specified label . Conditions: PGMIDERR. NOTAUTH.
PUSH & POP To suspend all current HANDLE CONDITION. Used for e. Rely on the system default action .earlier by a HANDLE CONDITION command... HANDLE CONDITION HANDLE CONDITION condition[(label)]. and 'label' specifies the location within the program to be branched .. If xxx=DFHRESP(NOSPACE) .. it can restore the Handle command using POP HANDLE . Remains active while the program is executing or until it encounters IGNORE/another HANDLE cond. HANDLE AID and HANDLE ABEND commands. On return from the command. or If xxx=DFHRESP(NORMAL) . IGNORE CONDITION IGNORE CONDITION condition condition . ‘condition’ specifies the name of the condition that is to be ignored( no action will be taken) Syntax : EXEC CICS ITEMERR LENGERR END-EXEC IGNORE CONDITION This command will not take any actions if the given two error occurs and will pass the control to the next instruction. a sub-program can suspend Handle commands of the called program using PUSH HANDLE While returning the control.. it can be tested by means of DFHRESP as follows. IGNORE CONDITION.System will terminate or suspend the task depending on the exceptional condition occurred..g. Syntax : EXEC CICS HANDLE CONDITION ERROR(ERRHANDL) LENGERR(LENGRTN) END-EXEC LENGERR will be handled by system 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.. while calling sub-pgms (CALL) While receiving the control. 'condition' specifies the name of the condition.. it contains a return code.
PGMLANG=COBOL PCT Entry DFHPCT TYPE=ENTRY TRANSID= name PROGRAM=name TASKREQ=pf6 RESTART=yes/no ( TRANSEC = 1to 64) RSLKEY= 1 to 24 resource level key SCTYKEY= 1 to 64 security key : : . DFHPPT TYPE=ENTRY. Syntax of Pop : EXEC CICS Pop Handle END-EXEC.PROGRAM=TEST.Syntax of Push: EXEC CICS Push Handle END-EXEC. 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.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) Processing Program Table – PPT DFHPPT TYPE=ENTRY PROGRAM |MAPSET= name [PGMLANG= ASM|COBOL|PLI] [RES= NO|FIX|YES] : : other options : Eg.
Records can be written in any order.DELETE. Journalling.) Defining Files can be done either by CEDA Transaction or DFHFCT Macro. Creating new indexes. In Addition. . Data Independence. (like dataset name.OPENED) File Handling in Programs Files should not be defined in the Program. A number of records can be added at a time.ACCMETH=VSAM. Files can be created using IDCAMS Utility. Program should not open or close a File.BROWSE. should be done using IDCAMS Only. Defining A File to CICS Files should be defined in FCT (File Control Table). Browsing One or Selected or All Records. Opening and closing Files.other options File Handling VSAM Different types of VSAM Datasets used in CICS are : ESDS Entry Sequenced Dataset KSDS Key Sequenced Dataset RRDS Relative Record Dataset Services Provided By CICS Basic Operations required for a file are Adding a Record. etc. DATASETNAME=NAME. permissible file service request. access methods. (Record Level Locking). Deleting an Existing Record. Defining Files In CICS. etc. Modifying an Existing Record. FCT will contain all the Information about a File.READ. Syntax of DFHFCT Macro DFHFCT TYPE=FILE. Re-indexing. Files cannot be created. SERVRQ=(ADD. CICS Provides Exclusive Control. FILSTAT=(ENABLED.UPDATE).
Length of the Record to be Retrieved or Written.Contains the Record Key. LENGERR. Next and Previous Records can be Read as required Using ReadNext and ReadPrev. Condition: DISABLED. updated or deleted. DUPKEY. RESP :. End the Browse Operation at last. Into/From (WS-Rec) :. RIDFLD :.Records can be inserted. NOTFND. Sequential Read Sequential Read is done by Browse Operation Establish the pointer to the First Record to be Read Using StartBr. IOERR. IOERR. Syntax for STARTBR EXEC CICS STARTBR FILE(filename) RIDFLD(data-area) END-EXEC.Name in the FCT. Browse can be re-positioned. NOTOPEN.Working-Storage Area defined in the program where the CICS Puts/Gets the Data. NOTFND. Random READ EXEC CICS READ File(filename) [SEt() | Into()] RIdfld(Rec-Key) END-EXEC. During Browse Operation. Important Key-Words Dataset/File :. Example for Random Read EXEC CICS READ File( 'INVMAS ') Into(WS-INVMAS-REC) Length(WS-INVMAS-LEN) RIdfld('7135950602') | RIdfld(WSEND-EXEC. Reading the Record after STARTBR Sequentially the Next or Previous Record can be read by a READNEXT or READPREV. NOTOPEN. The first READNEXT or READPREV will read the Record where the STARTBR INVMAS-KEY) . LENGTH :. Records cannot be Updated. Condition : DISABLED.Contains the return code of the executed command.
Condition: INVREQ RESETBR Its effect is the same as ENDBR and then giving another STARTBR. RBA value is returned and Record will be written at the end of the File. Syntax: EXEC CICS RESETBR FILE(filename) RIDFLD(data-area) END-EXEC. ENDFILE. . DUPREC. RIDFLD should be the Record Key. Condition : DUPKEY. Syntax of READNext/READPrev EXEC CICS READNext | READPrev FILE(name) INTO(data-area)|SET(ptr-ref) RIDFLD(data-area) END-EXEC. WRITE Command Adds a new record into the File. Syntax : EXEC CICS WRITE FILE(filename) FROM(data-area) RIDFLD(data-area) END-EXEC. LENGERR. Condition: IOERR. IOERR. MASSINSERTion must be done in ascending order of the Key. NOSPACE. LENGERR. NOTOPEN. For ESDS. SYNTAX: EXEC CICS ENDBR FILE(filename) END-EXEC. ENDBRowse ENDBRowse terminates a Previously issued STARTBR. The record will be written depending on the Key. Condition: DISABLED. IOERR. RIDFLD is not used but after write execution. For KSDS.has positioned the File Pointer. NOTFND. NOTFND.
IOERR. DUPKEY. LENGERR. Condition: DUPREC. Record can be deleted in two ways. Syntax: EXEC CICS DELETE FILE(filename) RIDFLD(data-area) END-EXEC. NOTOPEN. Syntax: EXEC CICS REWRITE FILE(filename) FROM(data-area) END-EXEC. Condition: DISABLED. SYSIDERR. NOTAUTH. REWRITE automatically UNLOCKs the Record after execution. DELETE Command Deletes a Record from a dataset. NOTFND.REWRITE Command Updates a Record which is Previously Read with UPDATE Option. RIDFLD with the full key in it. IOERR. Optional Condition: DISABLED. FILENOTFOUND. NOTOPEN. UNLOCK To Release the Record which has been locked by READ with UPDATE Command. NOSPACE. IOERR. Multiple Records Delete is possible using Generic Option. . Syntax: EXEC CICS UNLOCK FILE(filename) : [other options] END-EXEC. General Exceptions The following Exceptions usually will occur for ALL CICS File Handling Commands. and the record read with READ with UPDATE will be deleted.
Executing the Program. Preparing a Program CICS requires the following steps to prepare a Program.. Defining the Program in the CICS Region.DB2 CICS provides interface to DB2. EXEC SQL function [options] END-EXEC 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.INVREQ Communication With Databases CICS . The RCT must be link-edited into a library that is accessible to MVS DB2 – Precompiler Source Program (EXEC SQL. CICS programs can issue commands for SQL services in order to access the DB2 database.. | EXEC CICS. & .) DB2 Precompiler | CICS command translator | Compile By COBOL | Linkedit by Linkage editor | Load Module Program Preparation Introduction Preparing a Program to run in CICS Environment. Assemble or Compile the Translator Output. Translating the Program...
Hence.LANGUAGE=l] Userid & password values can be from 1-8 chars. 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. If any Copy Books are used in the Program. a Program Listing as SYSPRINT and a Translated Source in SYSPUNCH. Translation Translates the ‘EXEC CICS’ Statements into the Statements your Language (COBOL) Compiler can Understand.PS=password] [.Command Level Interpreter 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. This can be done either by using CEDA Trans. the Compiler Options can be specified as required.NEWPS=newpassword] [. the previous operator will be signed off CECI .sysid.Link the Program.. terminal id. there should not be any CICS Statements in the Copy Book. Before using the maps in programs. The Compilation of the CICS Program is the same as Language Program. The SYSPUNCH is given as the input to the Program Compiler. Defining the Program The Application should be defined and Installed into the PPT. CEMT-Master Terminal Transaction CEMT provides the following services 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 . In RACF. application id etc. CICS Supplied Transactions CESN/CESF Transactions To sign on to CICS system CESN [USERID=userid] [. The Translator gives two outputs. it can be tested using CECI to check how it appears on the screen. the Userid given in CESN is verified. or DFHPPT. Compiling or Linking As the CICS Commands have been translated.
current PUT to copy the current queue contents into TDQ GET to fetch TDQ for browsing PURGE erases the contents of the current queue .CEBR-Temporary Storage Browse 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.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.