You are on page 1of 151

IBMMAINFRAMES.

com
Presents

Complete Tutorial on CICS.

PART – I

INTRODUCTION TO CICS

Copyright: IBMMAINFRAMES.com

2

OBJECTIVES

   

Batch & Online systems
Why CICS? CICS System components CICS control program & tables CICS startup and shutdown
Copyright: IBMMAINFRAMES.com 3

com 4 .BATCH & ONLINE SYSTEM Batch System Online System Transaction file Online System Terminals Batch System DATABASE REPORTS MASTER FILE     ONLINE SYSTEM DEFINITION : ONLINE processing allows a user to interact with a computer and access its resources via a terminal Example : Railway Reservation system Copyright: IBMMAINFRAMES.

Multi task multi thread. sequential. initiates the job.com . Other jobs in entering transaction id the same region must wait. scheduled ONLINE Data from terminal random. Priority processing. no transactions can be entered. triggers the transaction to start. 5 Processing Single task single thread. Each transaction.BATCH & ONLINE SYSTEM BATCH Input Data from card tape. concurrent Start of A job Operator (or operating system) Once CICS is initialized. Priority in job scheduling Mode End of job Each job Copyright: IBMMAINFRAMES. disk Batched. Once CICS is terminated.

system to produce reports (day.com 6 . BATCH Output ONLINE printed reports. output files. Instant feed back month) Less More Resource Usage Example of application Monthly sales report Airline reservation system Copyright: IBMMAINFRAMES. week.BATCH & ONLINE SYSTEM Contd…. Message terminals User must wait for batch jobs updated files.

com 7 .WHAT IS CICS?  Customer Information Control System (CICS) was developed in 1960 by IBM  ONLINE CONTROL SYSTEM  General purpose data communication control system  Provides services to handle all the special requirements for online processing Copyright: IBMMAINFRAMES.

BATCH & ONLINE SYSTEM  Application Program Operating System (MVS/XA) Database Access Method (DL/I.TCAM. BTAM) Other Systems Data Storage CICS / MVS Terminals  Note : Role of CICS is to interface between application programs and the DB/DC control system. DB@) Database Method (VSAM/ BDAM) Telecommunication Access method (VTAM.com 8 . Copyright: IBMMAINFRAMES.

CICS SERVICES & THE OPERATING SYSTEM  Requests for file I/P.com 9 . O/P Copyright: IBMMAINFRAMES. O/P Requests for terminal I/P. O/P   Requests for database I/P.

CICS / VS CONTROL T E R M I N A L TASK CONTROL TERMINAL CONTROL CICS TABLES FILE CONTROL F I L E S PROGRAM CONTROL PROGRAM LIBRARY Copyright: IBMMAINFRAMES.com 10 .

com 11 .CICS CONTROL PROGRAM AND TABLES  CICS CONTROL PROGRAM (IBM SUPPLIED)  FCP (FILE CONTROL PROGRAM)  JCP (JOURNAL CONTROL PROGRAM)  KCP (TASK CONTROL PROGRAM)  PCP (PROGRAM CONTROL PROGRAM)  SCP (STORAGE CONTROL PROGRAM)  TCP (TERMINAL CONTROL PROGRAM)  TDP (TRANSIENT DATA PROGRAM)  TSP (TEMPORARY STORAGE PROGRAM) OTHERS Copyright: IBMMAINFRAMES.

com 12 .CICS CONTROL PROGRAM AND TABLES .Contd…  CICS CONTROL TABLES (USER SPECIFIED)  FCT (FILE CONTROL TABLE)  JCT (JOURNAL CONTROL TABLE)  PCT (PROGRAM CONTROL TABLE)  PPT (PROCESSING PROGRAM TABLE)  TCT (TERMINAL CONTROL TABLE)  DCT (DESTINATION CONTROL TABLE)  TST (TEMPORARY STORAGE TABLE) Copyright: IBMMAINFRAMES.

CICS System Initialization program (SIP) is the main job step SIP loads System Initialization Table (SIT) SIP further loads all control programs and tables   .com 13 .CICS START UP   CICS is submitted as a batch job.Perform initial housekeeping tasks Copyright: IBMMAINFRAMES.

com 14 . dumps and other reports and ends   No transaction can be executed after that Copyright: IBMMAINFRAMES.CICS SHUTDOWN  Master terminal transaction is entered with shutdown option CICS job produces various logs. statistics.

ROLE OF CICS   MULTI TASKING . Copyright: IBMMAINFRAMES. QUASI RE-ENTRANT .com 15   . RE-ENTRANT PROGRAM .More than one task can be executed concurrently.Tasks share the same program under the multi tasking environment.Program when does not modify itself in any way during execution.Is a reentrant program under the CICS environment. MULTI THREADING .

com 16 .Chapter .2 MAPS AND DISPLAYS Copyright: IBMMAINFRAMES.

com 17 .INTRODUCTION TO BMS  To make the application program device independent and format independent CICS provides Basic Mapping Support (BMS) BMS is a standard facility. to deal with the formatted screen operations Screen defined through BMS is called a "MAP"   Copyright: IBMMAINFRAMES.

PHYSICAL AND SYMBOLIC MAP  Physical Map Primarily used by CICS Ensures device independence in the application program For input operations. Copyright: IBMMAINFRAMES. and allows BMS to construct an output data stream. it defines the maximal data length and starting position of each field to be read and allows BMS to interpret an input data stream For output operations it defines starting position.com 18 . length. field characteristics (Attribute Bytes) and default data for each field.

com 19 .PHYSICAL MAP GENERATION BMS MACRO ASSEMBLY CODING LINK EDIT LOAD MODULE LOAD LIB TO BE USED BY CICS    Physical map is a program in the form of Load module Physical map is coded using BMS macros BMS macros are assembled separately and link edited into the CICS load library Copyright: IBMMAINFRAMES.

com 20 .SYMBOLIC MAP  Ensures the device and format independence to the application programs A layout change in the formatted screen can be done independent of the application program coding as long as field name and length remain the same   Symbolic map is included in the program by issuing a COBOL COPY statement Copyright: IBMMAINFRAMES.

USING MAPS IN A PROGRAM PROGRAM SOURCE TRANSLATOR COMPILER SYMBOLIC MAP LINK EDIT Program load module Physical map Copyright: IBMMAINFRAMES.com 21 .

com 22 . BMS Macros are coded.SYMBOLIC MAP GENERATION BM S ASS EMB LY M AC R O C ODIN G SYM BOLIC M AP D EFIN ITION C OPY LIB C OPIED IN TO C IC S APP LIC ATION PR OGR AM U SIN G C OPY STATE ME NT    Symbolic map is a copy library member Included in application program for defining the screen fields. assembled and catalogued into a COPY library Copyright: IBMMAINFRAMES.

com 23 .SYMBOLIC MAP SUFFIXES  “L” Halfward binary Contain the length of data entered by the terminal operator  “F” One byte flag field  “I” Contains the data entered by the operator  “A” One byte field that contains Attribute byte  “O” Contains data to be sent to terminal Copyright: IBMMAINFRAMES.

Copyright: IBMMAINFRAMES.  When performing input functions fields suffixed with “L”.  When performing OUTPUT functions.Contains the data to be sent to the terminal.com 24 . and “I” are meaningful. the fields suffixed with “A” and “O” are meaningful. “F”.SYMBOLIC MAP FORMAT Contd…  A 12 byte TIOA prefix is automatically provided.

Copyright: IBMMAINFRAMES. END-EXEC.com 25 .OUTPUT MAPPING “MAP ONLY” EXEC CICS SEND MAP (“mapname1‟) MAPSET („mapset1‟) MAPONLY END-EXEC “DATA ONLY” EXEC CICS SEND MAP („mapname1‟) MAPSET („mapset1‟) DATA ONLY.

Use the physical map only.OUTPUT MAPPING  MAP ONLY option.only the data in the symbolic map is sent to the screen. and the location of where all information is to be placed is sent. attribute bytes.Use the symbolic map only . .Field headings. . Copyright: IBMMAINFRAMES.  DATA ONLY .com 26 .

com 27 .The physical map and the data from symbolic map is sent to the terminal.OUTPUT MAPPING Contd…  Neither “ MAPONLY NOR DATAONLY EXEC CICS SEND MAP („map-name1‟) MAPSET („mapset1‟) END-EXEC . Copyright: IBMMAINFRAMES.

 FREEKB: to free the keyboard  ALARM: to make an alarms sound.OUTPUT MAPPING Contd…  Other options of SEND command. Copyright: IBMMAINFRAMES.  FRSET: to reset MDT to zero  CURSOR: to place the cursor in a specified field.com 28 .  ERASE: Current screen is erased before the map specified appears on the screen  ERASEAUP: erase all the unprotected fields.

 Dynamic / Relative positioning. Place (-1) into the field length field (“L” suffix).  Dynamic / symbolic positioning. Cursor will be placed in the field.CURSOR POSITIONING  Static positioning If IC option is specified in the ATTRB field of DFHMDF macro the cursor will be placed at this field. Cursor (data-value) option is used. Copyright: IBMMAINFRAMES.com 29 . Data-Value will have the value at which the cursor has to be positioned.

. Keys) without entering any data.If the data to be mapped has a length of zero.If the operator presses any key (clear.) MAPSET (…. Copyright: IBMMAINFRAMES. PA. ENTER.g.  MAPFAIL condition will caused in RECEIVE MAP command. .CURSOR POSITIONING Contd… E. EXEC CICS SEND MAP (….. PF..com 30 .) CURSOR (100) ERASE END-EXEC..

ACCESSING AND DISPLAYING MAP FIELDS Copyright: IBMMAINFRAMES.com 31 .

Copyright: IBMMAINFRAMES. acquiring temporary storage with the SET option.  WORKING .MAP STORAGE AREAS  Placing maps in the Program Any of the three plans for redefinition of maps may be used with either of the 2 alternatives for placing maps in your program.STORAGE SECTION Copying a symbolic description map structure here makes the area automatically available whenever the program is invoked. Some methods for providing storage are passing a COMMAREA. or using a GET MAIN command.  LINKAGE SECTION Copying a symbolic description map structure here does NOT mean the storage will be available.com 32 .

SEND / RECEIVE  Sending from the Symbolic description map SEND MAP (`MAP1') MAPSET(`SET1') MOVE `MAP1' TO MAPVAR MOVE `SET1' TO SETVAR SEND MAP (MAPVAR) MAPSET(SETVAR) FROM (MAP1O) SEND MAP Coding Alternatives You can code the SEND MAP command to locate the symbolic description map in several ways:  Using constants in the name field for MAP and MAPSET(FROM is not required) Copyright: IBMMAINFRAMES.com 33 .

 Copyright: IBMMAINFRAMES. In this case the name in the MAP option must be the MAPSET name.com 34 .SYMBOLIC MAPNAME IS SEND / RECEIVE .Contd…  Using variables in the name field for MAP and MAPSET (This makes FROM a required parameter) Using only the MAP parameter.

com 35 ..SEND / RECEIVE . MAP1 I RECEIVE MAP (MAPVAR) MAPSET(SETVAR) INTO (MAP1 I) Receive MAP (`SET1') . MAP1 I Move `MAP1' to MAPVAR Move `SET1' to SETVAR .... SET1 I RECEIVE MAP coding alternatives You can code the RECEIVE MAP command to locate the symbolic description map in several ways: Copyright: IBMMAINFRAMES...Contd… RECEIVING into the symbolic description map RECEIVE MAP(`MAP1') MAPSET(`SET1') ...

Contd…  Using constants in the name field for map and mapset (INTO/SET is not required) This is the most commonly used format.  Using only the MAP parameter.com 36 .SYMBOLIC MAPNAME IS SEND / RECEIVE .  Using variables in the name field for MAP and MAPSET. In this case the name in the MAP option must be the MAPSET name. This makes INTO (database) or SET a required parameter. Copyright: IBMMAINFRAMES.

Copyright: IBMMAINFRAMES. The symbolic description map must be in the LINKAGE SECTION. RECEIVE MAP (`MAP1') MAPSET (`SET1') SET (PTR-2-BMS) .SEND / RECEIVE . 02 PTR-2-BMS PIC S 9(8) COMP... 01 DFHCOMMAREA 01 LST 02 PTR-2-LIST PIC S 9(8) COMP..Contd… Linkage Section.com 37 . MAP1 I  Using the SET option requests CICS to get the storage and return a pointer to it..

OUTBOUND FUNCTIONS SEND MAP (`MAPA') MAPSET (`SETA') [ERASE/ ERASEAUP] [FREEKB] [ALARM] [FRSET] [PRINT] ERASE-Erase Buffer.com 38 . Copyright: IBMMAINFRAMES. place cursor in upper left corner then write or ERASEAUP-Erase all the unprotected fields before the Write FREEKB-Unlock Keyboard after the write ALARM-Active alarm with the write FRSET-Set all MDT currently on to off PRINT-Start the 3270 print operation.

OUTBOUND FUNCTIONS Control Functions:  Typically the first type of command in the program is a SEND MAP.com 39 . Selective resetting of the MDT's must be done another way. It will NOT alter any attribute settings. Copyright: IBMMAINFRAMES. Certain control functions may be included in that command. the operator will have to press the RESET key before entering data. all attribute bytes currently having Modified Data Tags (MDT) set on will be set off.  If you do not free the keyboard using FREEKB.  ERASEAUP will clear out each field whose attribute is unprotected.  When sending data to a 3270 screen the actual printing from the buffer will occur when the PRINT function is requested.  If you code FRSET.

com 40 . Copyright: IBMMAINFRAMES.OUTBOUND FUNCTIONS Contd… Attributes : The `A' suffixed field is an attribute field which controls the following : PROTECTED/UNPROTECTED ASKIP NUM MDT Non Display (dark)DISPLAY (normal/bright)  If the color or highlighting of a field has to be changed. additional symbolic fields are needed which are called the EXTENDED ATTRIBUTES.

the generated symbolic map follows. Copyright: IBMMAINFRAMES.com 41 .  To illustrate the result of coding these parameters.EXTENDED ATTRIBUTES  DSATTS (for symbolic map) and MAPATTS (for physical map) support the extended attribute characteristics  The MAPATTS allows you to set up the physical map with any of the characteristic(s) coded.  The DSATTS will create appropriate suffixed labels for the attribute characteristic(s) coded.

02 FILLER REDEFINES NAMEF. 02 NAME F PICTURE x.com 42 . 01 MAP1I. 02 NAMEL COMP PIC 39(4). COPY MAPSETTA. PART I WORKING-STORAGE SECTION.COPY MAPSETA. 02 NAMEA PICTURE x. 02 FILLER PIC x(12).OUTBOUND FUNCTIONS  The generated symbolic map: . Copyright: IBMMAINFRAMES. 02 FILLER PIC X(5) 02 NAMEI PIC X(20).

02 NAMET PICTURE x. Copyright: IBMMAINFRAMES. 02 NAMEH PICTURE x. 02 NAMEO PIC x(20). 02 NAMEC PICTURE x. 02 FILLER PIC x(12).com 43 . 02 NAMEP PICTURE x. PART2 01 MAP10 REDEFINES MAP1I. 02 FILLER PICTURE x(3).OUTBOUND FUNCTIONS Contd…  COPY MAPSETA. 02 NAMEU PICTURE x.

AID / CURSOR CONTROL  Attention Identifier (ID) and Cursor:  On a RECEIVE.com 44 . Copyright: IBMMAINFRAMES. CICS updates the EIB with the following information : -The screen cursor position relative to zero is placed is EIBCPOSN. -The name of the input key the terminal operator pressed is placed in the field EIBAID.INBOUND FUNCTIONS .

... you can test EIBAID and/or EIBCPOSN. IF EIBAID = DFHENTER THEN .EIBAID/CURSOR WORKING-STORAGE SECTION.  When you first enter your program as a result of a transaction id. This may be done prior to issuing a RECEIVE command...com 45 .... IF EIBCPOSN LESS THAN 80 THEN ..... PROCEDURE DIVISION...... .. COPY DFHAID... if so chosen. IF EIBAID = DFHPF12 THEN . Copyright: IBMMAINFRAMES.

for eg.com 46 . Thus testing for the type of AID will alter the logic flow.AID/CURSOR . This information is especially useful with screens containing an action bar. Copyright: IBMMAINFRAMES.SAMPLE CODING (CONTROL)  If the operator uses any PA key or presses the CLEAR key.  EIBCPOSN can be used to determine where the cursor was positioned on the screen. no data is transmitted  EIBAID is useful when function keys are defined for the user. PF12 may be the exit function PF3 may be an update function etc.

LENGTH=20. ATTRB=(UNPROT. INITIAL=`NAME'.MODE=INOUT. TIOAPFX=YES. STORAGE=AUTO MAP1 DFHMDI SIZE=(24.com 47 . ATTRIB=ASKIP NAME DFHMDF POS(2.LINE=1.LANG=COBOL.6).80). IC) DFHMDF POS(2. ATTRB=PROT Copyright: IBMMAINFRAMES.COLUMN=1.1). CURSLOC=YES DFHMDF POS(2. LENGTH=1.CURSLOC Sample Map MAPSETA DFHMSD TYPE=&SYSPARM.27). LENGTH=4. TERM=ALL.

CURSLOC - Contd…
 CURSLOC= YES allows you to determine after a RECEIVE MAP command, which map field had the cursor in it. CURSLOC=NO is the default.  CURSLOC=(NO/YES) may be coded on the DFHMSD or the DFHMDI macro. If coded on the DFHMSD macro, it will provide a default for all the maps in that mapset.  When CURSLOC=YES, BMS will set the `F' suffix field to X'02' indicating that field contained the cursor. If the cursor is in a field for which there is no symbolic label (i.e. a DFHMDF with no label the program will not be notified. Note : The `F' suffix field continues.
Copyright: IBMMAINFRAMES.com 48

CURSLOC - Contd…
To be used to indicate the operator pressed the erase to end of fixed (EOF) key by being set to X'80'.

Therefore, if CURSLOC=YES it is possible to have both these conditions occur for the same field, in which case the `F' suffix field will contain a X'82'.

Copyright: IBMMAINFRAMES.com

49

EDITING
 Map field Definition PICIN/PICOUT  Built in function De-edit command - When data is sent out via the `O' suffix fields or received into the `I' suffix fields you may want a definition other than PIC x. PICIN AND PICOUT allows the user to use other COBOL PICS such as $,Z etc. - If the date contains special characters, you may want to remove them using the BIF DEEDIT command.

Copyright: IBMMAINFRAMES.com

50

PICIN tells BMS how to move data into the `I' suffix field. . Copyright: IBMMAINFRAMES.If PICIN/PICOUT is not coded in the macro.PICOUT tells COBOL how to edit your data move to the `O' suffix field. .com 51 .PIC IN/PIC OUT . the pic generated is always PIC X (length of field) .By using PICIN/PICOUT BMS can be forced to generate the appropriate PIC.

FIELD EDIT BUILT-IN FUNCTION Amount $5431.80 BIF EDIT Amount 00543180 EXEC CICS BIF DEEDIT FIELD (amount) LENGTH (8) END-EXEC. Copyright: IBMMAINFRAMES.com 52 .

com 53 .BIF DEEDIT is used to remove the special characters from the input field. Copyright: IBMMAINFRAMES.  COBOL compiler requires LENGTH specification: VS COBOL-II uses the implied length of the data-area used in the field parameter. Thus the number can be used for arithmetic operations.FIELD EDIT .  The Amount field displayed has a dollar sign and a decimal point  By using BIF DEEDIT dollar sign and decimal point is removed.

com 54 .CICS PROGRAM COMPONENTS Copyright: IBMMAINFRAMES.

com 55 .OBJECTIVES         Structure of CICS Application Program CICS Management Functions Starting a Task Conversational& Pseudoconversational transactions CICS Program preparation CICS Program testing & Debugging CICS commands Passing Data across tasks Copyright: IBMMAINFRAMES.

are optional but recommended Author Date-Written Date-compiled Remarks Environment Division Only header is required Copyright: IBMMAINFRAMES.com 56 .ID required  Other comments as below.STRUCTURE OF CICS APPLICATION PROGRAM Identification Division Program .

DISPLAY. DATE.STRUCTURE OF CICS APPLICATION PROGRAM . ACCEPT. REWRITE. STOP RUN. START) REPORT WRITER feature SORT feature Copyright: IBMMAINFRAMES. DAY.com 57 . TRACE Any I/O Statements (OPEN. EXHIBIT. CLOSE.Contd…   COBOL statements and CICS commands should be coded The following COBOL statements are prohibited. READ. CURRENT-DATE. DELETE. WRITE.

Copyright: IBMMAINFRAMES.com 58 .STRUCTURE OF CICS APPLICATION PROGRAM Contd…  CALL statement is allowed if the called program does not issue any CICS commands or inhibited COBOL statements mentioned above.

 Control must not be allowed to pass beyond the last statement of a CICS Program. COBOL and VS COBOL II have three statements to conclude programs. Copyright: IBMMAINFRAMES.TERMINATION STATEMENTS CALLER CICS SYSTEM CALL GOBACK STOPRUN CALLED GOBACK EXIT PROGRAM STOPRUN Notes :This is not the way to terminate a CICS program.com 59 . CICS has a command for that purpose. Nevertheless.

and therefore.com 60 .  EXIT program is ignored if the program has not been called.  CICS RETURN COMMAND and/or GOBACK statement is recommended. is discouraged. Copyright: IBMMAINFRAMES.TERMINATION STATEMENTS Contd…  STOP RUN in COBOL uses operating system facilities.

Copyright: IBMMAINFRAMES.com 61 .CICS MANAGEMENT FUNCTIONS Task File Program Security CICS System Services Recovery Terminal Queue .

DEFINITIONS    Transactions An exchange between a terminal and a data base representing an application process. an inquiry or a deposit and balance update Task A specific instance of a transaction i. a unique unit of work.com 62 . For example. Copyright: IBMMAINFRAMES. Program Prepared statements compiled or assembled into an executable module of machine instructions.e.

Program waits until the user responds. Very inefficient way of conversing with the user.com 63 . Resources are held until the user responds.CONVERSATIONAL TRANSACTION  Program uses a pair of SEND and RECEIVE commands.    Copyright: IBMMAINFRAMES.

CICS provides a facility (COMMAREA) to made it easier to accomplish this. Copyright: IBMMAINFRAMES. When the user completes response (by pressing enter) reset task is automatically initiated by CICS. The task receives the message from the terminal & processes it.PSEUDO CONVERSATIONAL TRANSACTION     The task is terminated after a message is sent with a linkage for the next task.com 64 . This is a multitask operation from system's point of view.

com 65 .CONCURRENT EXECUTION  The procedure Division represents the executable instructions of a program. each task requires its own unique set of data items.  The working storage section contains data items used by the program. tasks cannot share data items. Copyright: IBMMAINFRAMES. In CICS.  Working storage is not the only type of storage maintained by CICS for each executing task.  The command level interface initialized each task copy of invoking storage according to the VALUE classes in the program before program gets control. tasks may concurrently use the same program.

PROGRAM PREPARATION Source DB2 Precompiler CICS Translator COBOL Compiler Link Edit Load Module . Copyright: IBMMAINFRAMES.com 66 .

DB2 precompiler precedes another process.  Messages or warnings are provided on all the listings. binding.  Output of the DB2 precompiler can serve as input to the translator. Copyright: IBMMAINFRAMES.com 67 . not mentioned here.PROGRAM PREPARATION Contd…  Running the DB2 precompiler first is the preferred method.  Output of the translator will be input to the compiler.

com 68  . COBOL PERFORM and CALL statements. They are commented out and replaced with statements in the appropriate language.  DB2 Precompiler . It recognizes EXEC SQL statements which it will comment out and replace with in our case.The translator recognizes EXEC CICS and EXEC DLI statements. Here. Copyright: IBMMAINFRAMES. COBOL MOVE instructions and a CALL are inserted and passed on to the COBOL compiler.PROGRAM PREPARATION Contd… TRANSLATOR . DB2 and SQL/DS.The DB2 precompiler is supplied by the relational data base managers.

com 69 . The load module is placed in the CICS online program library.PROGRAM PREPARATION Contd…  Output of the transaction is i/p to the compiler  The o/p of the linkage editor is executable. Messages or warnings are provided on all the listings.  Copyright: IBMMAINFRAMES. The compiler listing is or limited use if the translator listing would not process all commands.

TESTING New Load Module Old Load Module .com 70 . Copyright: IBMMAINFRAMES.

The CICS processing program table PPT still points to the old-version.  To avoid testing with the old version.TESTING Contd… CEMT set program (prg1) New comp Or CEMT S PR (prg1) N  After making changes to a program the new version replaces old version. Copyright: IBMMAINFRAMES.com 71 . you must use the CICS-provided CEMT transaction to update the pointer to the program. but CICS which is currently executing has no way of knowing this automatically.

. options and their argument values. else statement  The translator will place a period into the generated code if a period follows end-exec. function. delimiter. Avoid them after END-EXEC. within an  If ..  Be careful about periods.. Copyright: IBMMAINFRAMES... Where you don't really want them. For eg. then .com 72 .COMMON FORMAT EXEC CICS SEND FROM (FLDA) LENGTH (5) ENDEXEC Delimeter Keywords Function Option Argument Option Argument  A CICS command consists of a keyword phrase.

area name label hhmmss pointer-ref . 05 Fld 1 05 Fld 2 COBOL data name Character string Paragraph name PIC S9(7) comp 3 Packed decimal BLL cell Usage pointer Copyright: IBMMAINFRAMES.value PIC S9(4) comp Halfword binary PIC S9(8) comp Fullword binary PIC X(15) character string constants permitted COBOL data name eg :(Not a constant) 01 Record-area.ARGUMENT VALUES data .com 73 data .

A receiving area must be defined in working storage section and has to be specified in the INTO parameter. It has to be specified in length option.RECEIVE COMMAND  EXEC CICS RECEIVE INTO (data area) LENGTH(ml) END-EXEC - - RECEIVE command is used to receive incoming data from the terminal to which this CICS transaction is associated. Length field must be defined in working storage section as a S9(4) comp.com 74 . Copyright: IBMMAINFRAMES.

SEND COMMAND
 EXEC CICS SEND FROM (data area) LENGTH(ln) END-EXEC The data to be sent must be stored in working storage section, and this field name has to be specified in the FROM parameter. Length must be specified the same as that of the Receive command.
Copyright: IBMMAINFRAMES.com 75

EXCEPTIONAL CONDITIONS
 RESP option Define a full word binary field S9(8) comp in the working storage section as the response field. Place RESP option with the response field in any CICS command. After command execution, check the response code in the response field with DFHRESP (xxxx) where xxxx is NORMAL for normal completion Or Any exceptional condition
Copyright: IBMMAINFRAMES.com 76

HANDLE CONDITION
 Handle condition command is used to transfer control to the procedure label specified if the exceptional condition, specified occurs.  Remains active until the end of program or another handle condition request overrides it.

Copyright: IBMMAINFRAMES.com

77

IGNORE CONDITION  Ignore condition command causes no action to be taken if the condition specified occurs in the programs.  Request by the IGNORE CONDITION command is valid until the subsequent HANDLE CONDITION command for the same condition. Copyright: IBMMAINFRAMES.com 78 .

NO HANDLE OPTION If NOHANDLE option is specified in any CICS command..) Length (.com 79  ..) NOHANDLE END-EXEC Copyright: IBMMAINFRAMES.. no action will be taken for any exceptional condition occurring during execution of this command.. Eg : EXEC CICS SEND From (.

EIBDATE and EIBTIME fields have the values at the task initiation time.used to request the current date and time .com 80 .  FORMAT EXEC CICS ASKTIME END-EXEC Copyright: IBMMAINFRAMES.FORMATTING TIME AND DATE  ASKTIME Command .

Format [YYDDD (data .area)] [DDMMYY (data .area)] [TIME (data .area)] [YYDDMM (data .area)] [YEAR (data .com 81 .area)] [TIMESEP (data .area)] [MMDDYY (data .area)] [YYMMDD (data .area)] [DAY OF MONTH (data .used to receive the information of data and time in various formats.area)] [DATESEP(data .value)] Copyright: IBMMAINFRAMES.FORMAT TIME COMMAND .area)] [MONTH OF YEAR (data .value)] [DAY OF WEEK (data .

TIMESEP represents time separator (default is ":").FORMAT TIME COMMAND Contd… DATESEP represents data separator (default is "/"). Copyright: IBMMAINFRAMES.com 82 . - The data area for the ABSTIME option of ASKTIME and FORMATTIME commands must be a 15-digit packed decimal data type.

com 83 .DELAY COMMAND  DELAY command - used to delay the processing of a task for the specified time interval or until the specified time.Task will be suspended for 20 minutes if INTERVAL is specified or until 15:20:00 if TIME is specified. Copyright: IBMMAINFRAMES.EXEC . FORMAT EXEC CICS DELAY INTERVAL (002000) TIME (152000) End .

COMMAREA - Passing data via the COMMAREA pseudo conversational task to task Linking program to program Copyright: IBMMAINFRAMES.com 84 .

PSEUDO CONVERSATIONAL PCT ENTRIES TRN 1 TRN2 Program 1 Program 2 Program 1 Send Return Transid TRN 2 Program 2 Receive Send Return RETURN TRANSID will terminate the task and specify the next transaction ID as TRN2 When the operator enters data. Copyright: IBMMAINFRAMES.com 85 . TRN2 will automatically start (a task will be created) and the program program 2 will be invoked.

com 86 .PASSING DATA TO NEXT TASK TRN1 Working Storage comstart Copy comstart Program 1 Procedure Return Transid ('TRN2') Commarea (Constant) TRN2 Program 2 Linkage DFHcommarea A commarea is a CICS maintained unit of storage for passing and receiving data between CICS program The first time a COMMAREA is passed. It must begin as an area storage in the working storage section of the program passing commarea. Copyright: IBMMAINFRAMES. The RETURN statement has a parameter for passing a COMMAREA to the program associated with a subsequent transaction.

Copyright: IBMMAINFRAMES.com 87 . it will automatically have access to all COMMAREA fields.PASSING DATA TO NEXT TASK . Having done that.Contd…  The subsequent program (the receiver of the commarea) MUST define DFHCOMMAREA in its LINKAGE SECTION.

Copyright: IBMMAINFRAMES. The Return transid will terminate the task and specify the next transaction. When the operator enters data PAYR will automatically start (task will be created) and the program PAYROLL will be invoked.com 88 .PSEUDO CONVERSATIONAL PCT PAYR ENTRIES PAYROLL Payroll Send Return Transid (Payr) Payroll Receive Send Return Notes :  This pseudo conversational design will invoke the same program for each part of the conversation.

PASSING DATA TO NEXT TASK
PAYR
Working Storage comstart commarea

Pay Roll Procedure Return Transid ('PAYR') Commarea (Constant)

PAYR PAYROLL

Linkage DFHcommarea

Notes :  The first time commarea is passed, it must begin as an area of storage in the working storage section of the program passing it.  A commarea parameter in the RETURN will pass the area to the program associated with the subsequent transaction. In this case, itself.  The subsequent program (in this case the same program) must define access to all the commarea that was passed to it.
Copyright: IBMMAINFRAMES.com 89

PASS DATA TO NEXT TASK - Contd…
 PAYROLL as both the sender and the receiver of the COMMAREA needs the working storage definition to send and the linkage section DFHCOMMAREA to receive.
 PAYROLL must therefore be able to distinguish between FIRST TIME into the program. When there is no COMMAREA and subsequent times in. Where one exists in the Linkage section. The EIB field, EIBCALEN indicates the length of the commarea.
Copyright: IBMMAINFRAMES.com 90

EIBCALEN
 First time into the program no commarea exists, therefore EIBCALEN = 0

-

While returning the control to CICS the working storage is loaded and this is sent via the commarea parameter in the RETURN Transid. On subsequent entry, commarea exists and is automatically made addressable by CICS in the linkage section of DFHCOMMAREA
Copyright: IBMMAINFRAMES.com 91

This happens when the linked program issues a RETURN command.PASSING DATA USING LINK To pass control from one program to another and then return to the original like executing a subroutine.  The link command passes control to another program defined in CICS PPT expecting that the program will return to the linking program instruction following the LINK command.com 92 . Copyright: IBMMAINFRAMES.

  The working storage section for the linking program is retained. Working storage for the linked program is automatically released after its RETURN command is executed.com 93 .Contd…  Data may be passed using the commarea.PASSING DATA USING LINK . Copyright: IBMMAINFRAMES. The two programs executive under the same task.  The commarea is shared between the two program regains control may changes made to the commarea by the linked program are accessible.

This happens when the linked program issues a RETURN command.PASSING DATA USING LINK Working Storage comstart Program 1 Program 2 Procedure Link Commarea (Constant) Linkage DFHCOMMAREA procedure Return To pass control from one program to another and then return to the original like executing a subroutine. Copyright: IBMMAINFRAMES.  The link command passes control to another program defined in CICS PPT expecting that the program will return to the linking program instruction following the LINK command.com 94 .

Reading External Data Copyright: IBMMAINFRAMES.com 95 .

VSAM DATA STRUCTURE BROWSE .RELATIONAL TABLE ROW BROWSE .OBJECTIVE Functional overview DIRECT RETRIEVAL .RELATIONAL TABLE ROWS Copyright: IBMMAINFRAMES.VSAM DATA STRUCTURES DIRECT RETRIEVAL .com 96 .

com 97 .FUNCTIONAL OVERVIEW CICS FCT RDB CICS Attachment Facility FILEA Data base FCP PROGRAM EXEC CICS READ FILE C ('FILE') EXEC SQL EIP Copyright: IBMMAINFRAMES.

com 98 . programmer need not define the physical organization and other attributes of the files. Copyright: IBMMAINFRAMES.Interface between CICS and Relational Database is called CICS attachment Facility. So.FUNCTIONAL OVERVIEW contd… Entry for VSAM file has to be there in FCT (File Control Table)  Each entry contains all descriptive information for the file it represents. Statement are coded in SQL language in the application program to Communicate data requests to the database.The File parameter coded in the program must be the same as the file name in the FCT. . .

SET OF RELATIONAL TABLE WORKS Copyright: IBMMAINFRAMES.RELATIONAL TABLE ROW  BROWSE .VSAM FILE RECORD .com 99 .TOPICS  DIRECT RETRIEVAL .VSAM FILE RECORDS .

VSAM DATA STRUCTURES Key = 5 3 5 9 Sequential Keyed Record 4 R1 R2 R3 Relative record  CICS uses the following VSAM structures .Relative record dataset (RRDS) Copyright: IBMMAINFRAMES.Key sequenced data set (KSDS) .Entry sequenced dataset (ESDS) .com 100 .

PROGRAM ORGANIZATION W o r k in g S to ra g e R e c o r d la y o u t D e f in itio n R e c o r d k e y file d L in k a g e s e c tio n E IB P r o c e d u r e D iv is io n ID e n t ry k e y o f r e c o r d t o b e re a d E X E C C IC S R e a d f ile .. Application program is not responsible for open / close of files Copyright: IBMMAINFRAMES..com 101 .. In response to a file access request from an application if the file is closed In response to a master terminal CEMT request from an operation.  File attributes are defined in the FCT for each file Files are opened by CICS Immediately after system initialization if specified in the FCT.

RECORD IDENTIFICATION  RECORD KEY  RELATIVE BYTE ADDRESS  RELATIVE RECORD NUMBER  PARTIAL KEY . key length has to be provided RBA (Relative Byte Address) Can also be used instead of actual key value   For ESDS RIDFLD contain a 4 byte RBA For RRDS RIDFLD contains 4 Byte binary relative record number.com 102 . Copyright: IBMMAINFRAMES.key of the record to be read is specified in the RIDFLD. for KSDS Key specified can be a full key or partial key If partial key.

RECORD KEY DEFINITION EXAMPLE WORKING .STORAGE SECTION 05 RECKEY PIC X(6) PROCEDURE DIVISION MOVE VALUE TO RECKEY  RIDFLD must be set to the value of the key of the record to be retrieved.com 103  . Copyright: IBMMAINFRAMES. RIDFLD must be large enough to hold a full record key even when a partial key is used.

It must be defined in FCT. It indicates maximum length of the record to be read.READ COMMAND  F READ command with INTO Option. The data content of the record is moved into the specified dataarea defined in the working storage section. FORMAT EXEC CICS READ DATASET (name) | FILE (name) INTO (data-area) | SET(ptr-ref) RIDFLD (data-area) [ LENGTH (data-values) ] END . DATASET / FILE names the file. RIDFLD is the key field.com 104 . LENGTH is half word binary. It is optional.EXEC. - INTO names the field in the working storage section where the data has to be placed. Copyright: IBMMAINFRAMES. (FULL KEY) Reads the record specified by the full key.

com 105 . Copyright: IBMMAINFRAMES. NOTOPEN NOTOPEN : When file specified is not open. : If the record is not found for the key specified. The exceptional condition can be trapped using RESP option in the READ command. (in LENGTH LENGER R LENGERR : The specified length OPTION) is shorter than the actual record length.EXCEPTIONAL CONDITIONS DUPKEY NOTFND : If duplicate record is found for the specified key.

FORMAT EXEC CICS READ FILE („FILEAAA‟) INTO (FILE-IOAREA) RIDFLD (REC-KEY) KEYLENGTH (3) GENERIC LENGTH (WS-LEN) END-EXEC KEY LENGTH specifies length of Generic key. (i.com 106 . instead of full key. Copyright: IBMMAINFRAMES.READ  READ command with GENERIC OPTION n Used to read a nonspecific record based on the generic key.e. higher part of key) specified.

EXEC CICS READ DATASET („FILEAAA‟) INTO (data-area) RIDFLD (REC-KEY) KEYLENGTH (3) GENERIC LENGTH (WS-LEN) END-EXEC.com 107 .KEY.LEN MOVE „BAG‟ TO REC .EXAMPLE MOVE 50 TO WS . DATA IN FILE ARG 112 ARG 111 BAG 110 BAG 112 This record will be read as this is the first TRG 111 record with generic key „BAG‟ EXCEPTIONAL condition : INVREQ: Key length specified is greater than the actual key length of the record Copyright: IBMMAINFRAMES.

READ COMMAND  READ command with GTEQ option - Used to read a non-specific record whose key is equal to or greater than the full key data specified.EXEC. FORMAT EXEC CICS READ FILE („FILEAAA‟) INTO (data-area) RIDFLD (REC-KEY) GTEQ <---.com 108 . Copyright: IBMMAINFRAMES.Greater than or equal to LENGTH (WS-LEN) Search. END .

BROWSE COMMANDS Establish position STARTBR RETRIEVE RECORD READPREV CHANGE POSITION READNEXT RESETBR END BROWSE ENDBR Copyright: IBMMAINFRAMES.com 109 .

Copyright: IBMMAINFRAMES.Terminate browse  Record retrieved as a part of browse cannot be updated during browse.Retrieve and process records .Establish position .BROWSE  BROWSE .VSAM FILE RECORDS .com 110 .

OPTIONS : GTEQ  If no record is found for exact key. CICS places position to next available record EQUAL  If no record is found for the exact key.com 111 . OTFND : Specified Record is not found Copyright: IBMMAINFRAMES.  DSIDERR : File specified is not found in FCT.STARTBR  STARTBR COMMAND . exceptional condition NOTFND occurs GENERIC Places the position at the first record of partial key Exceptional conditions.to establish starting position for a file FORMAT EXEC CICS STARTBR FILE (name) RIDFLD (data-area) GTEQ END-EXEC.

READNEXT  READNEXT command Used to read a record of a file sequentially forward STARTBR must be successfully completed before READNEXT command FORMAT EXEC CICS READNEXT FILE (name) | DATASET(name) INTO (data_area) LENGTH (data_value) RIDFLD (data_area) END-EXEC. ENDFILE : End of file detected. LENGERR: Actual record length greater than the length specified Copyright: IBMMAINFRAMES. EXCEPTIONAL CONDITIONS.com 112 - . DUPKEY : If Duplicate record is found for key specified.

Copyright: IBMMAINFRAMES. this condition occur.READPREV READPREV command Used to read a record of a file sequentially backward STARTBR must have been successfully completed before READPREV command Options and parameters are same as READNEXT command EXCEPTIONAL Conditions NOTFND: INVREQ: If no record is found for key specified Generic option must not be used in the STARTBR command prior to READPREV command if used.com 113 .

com 114 .ADDRESSABILITY TECHNIQUES Copyright: IBMMAINFRAMES.

The required. Copyright: IBMMAINFRAMES. IF EXCEPTION = DFHRESP (PGMIDERR) a module given control through the use of a CICS XCTL command will not return to the program that issued the XCTL. program name is character string constant (max 8 characters) The PGMIDERR exception condition occurs when the name is not in the PPT.XCTL COMMAND EXEC CICS XCTL PROGRAM (PROGRAM NAME) RESP (EXCEPTION) END-EXEC.com 115 - .

The linking program and its storage area remain available. Copyright: IBMMAINFRAMES.com 116 .LOGICAL LEVELS Level 0 Level 1 The CICS System First Program Linking Level 2  Second Program The linked to program runs at a new logical level and returns to a logical level back to the linking program.

Copyright: IBMMAINFRAMES.  Any linked program could use the same COMMAREA of the parameters so indicated.  The transid & commarea option easy enough to use to make this method practical.Contd… Commarea Link Return Notes :  To quit the repeated execution simply RETURN without the TRANSID option.com 117 .LOGICAL LEVELS .

PROGRAMS TO PROGRAM TRANSITION      CICS LINK CICS XCTL COBOL CALL Alternative to XCTL or LINK  COBOL CALL COBOL CALL passes control to other programs. Copyright: IBMMAINFRAMES.com 118 .

Receiver uses EXEC CICS RECEIVE command Copyright: IBMMAINFRAMES.IN IN-AREA PROG MNU Move . PROCEDURE PROCEDURE . PROG BWS Move .PASSING DATA USING INPUT MSG MENU WORKING STORAGE WORKING STORAGE MENU . . XCTL (PROG BWS) .  . INPUT MSG (MENU-IN) RETURN INPUT MSG & INPUT LEN INPUT LEN (11)PARAMETERS USED WITH XCTL OR LINK.. RECEIVE INTO (INAREA) ..com 119 . . . .

Length 100 Data violation as 2nd Program (receives) tries to move 200 char Copyright: IBMMAINFRAMES.PASSING DATA USING LINK AREA1 PIC x (200)  dotted Linkage Section 01 DFHCOMMAREA 05 AREA2 PIC X(200) COMMAREA(AREA1) LENGTH(100) EIBCALEN=100  1ST Program .COMMAREA .com 120 .

PASSING A COMMAREA WITH XCTL WORKING STORAGE WORKING STORAGE
COPY PROG MNU
CONSTANT

PROG BWS

PROCEDURE

. .

LINKAGE SECTION DFHCOMMAREA PROCEDURE RETURN

.

XCTL COMMAREA (COMSTART)

.

If data is to be passed to the XCTLed program, a COMMAREA can be used. Data area is to be located in the Linkage Section of the receiving program. COMMAREA used with RETURN, LINK & XCTL

Copyright: IBMMAINFRAMES.com 121

.

ADDRESSABILITY
 DFHCOMMAREA & DFHEIBLK : Addressable automatically by CICS Dynamically acquired storage : Addressable by program

 Not necessary to always do a EXEC CICS GETMAIN explicitly
Copyright: IBMMAINFRAMES.com 122

CICS QUEUEING FACILITIES

Copyright: IBMMAINFRAMES.com

123

They are  Transient data Queue (TDQ)  Temporary storage Queue (TSQ).CICS QUEUEING FACILITIES  Two facilities to store data that are temporary in nature.com 124 .  This data is created or collected by one or more online transaction to be used later by the same transaction or by a different transaction or even later passed to a batch program. Copyright: IBMMAINFRAMES.

TRANSIENT DATA QUEUE  They are identified by a 4 character ID called destination ID Destination ID and other characteristics of TDQ are defined in the destination control table (DCT) by the system programmer.com 125 . 2 types of TDQ‟s   - Intra Partition TDQ Extra Partition TDQ Copyright: IBMMAINFRAMES.

com 126 .TRANSIENT DATA QUEUE Contd… Intra Partition TDQ Processed only within the same CICS region Extra Partition TDQ Individual Sequential Files processed between the transaction of the CICS region and the system outside of the cics region Copyright: IBMMAINFRAMES.

Copyright: IBMMAINFRAMES.     Record can be written sequentially.INTRA PARTITION TDQ  All Intra partition TDQ are stored in only 1 physical file (VSAM) Record from the queue can be returned sequentially.com 127 . Records can be of variable length format Several tasks can write to the same TDQ but only one task can read from TDQ.

Applicati on program 1 TDQ Appl . Copyright: IBMMAINFRAMES.INTRA PARTITION TDQ Contd… Intra Partition TDQ is used in application such as  Interface among CICS transaction. Pgm 2 report Automatic task Initiation (ATI) Message routing Message Broad cast.com 128    .

EXTRA PARTITION TDQ  Extra partition TDQ is a separate physical file & may be a disk. Copyright: IBMMAINFRAMES. DCT determines the initial open / close status of a file while the file can be opened or closed through the master terminal transaction during CICS session. Records are fixed. variable. tape or reporter. blocked or unblocked.com 129    . TDQ can be defined as an Input or output but not both.

com 130 . TSO.APPLICATION (1) Interface to batch. Copyright: IBMMAINFRAMES. or PC) CICS Application TDQ -File Batch prog (2) Interface from Batch Batch Prog File TDQ CICS Appl PROG.

com END-EXEC. Deletion of TD's EXEC CICS DELETEQ TD QUEUE (NAME) Copyright: IBMMAINFRAMES. Common for both TDQ's Transient data input EXEC CICS READQ TD QUEUE (NAME) INTO (DATA-VALUE) [LENGTH (DATA-VALUE)] END-EXEC. 131 .TRANSIENT DATA OUTPUT EXEC CICS WRITEQ TD QUEUE (NAME) FROM (DATA-AREA) [LENGTH (DATA-VALUE)] END-EXEC. Common for both TDQ's.

com 132 . Deletes all records associated with t the named destination.  Copyright: IBMMAINFRAMES.TRANSIENT DATA OUTPUT   Appears only for Intra-partition TDQ. All associated storage is released.

com 133 .EXCEPTIONAL CONDITIONS (i) Special handling required LENGERR .length specified is greater than the maximum record length specified in DCT Qzero . The dest ld specified cannot be found (ii) Copyright: IBMMAINFRAMES.Destination empties or end of TDQ error Qlderr in DCT.

com 134 .Contd… TSP AUXILIARY TEMPORARY STORAGE EXEC CICS READQ / W RITE Q TEPRSTOR TS RECORDS VSAM (ESDS) Copyright: IBMMAINFRAMES.LOGICAL LEVELS .

TEMPORARY STORAGE QUEUE . Copyright: IBMMAINFRAMES. Used as a scratch pad Queue ID is of length 1-8 bytes TSQ is of variable length Records can be stored in main or auxiliary storage The records once written remains accessible until the entire TSQ is deleted  Records can be read sequentially or directly  Records can be re-read & updated.Contd…        TSQ is a queue of stored records. Created & deleted dynamically by application program.com 135 .

If this option is coded CICS write return the item number assigned to the record just written. Will be stored in main if auxiliary storage not supported. .com 136 ITEM .WRITEQ TS To write or re-write a record in TSQ EXEC CICS WRITEQ TS QUEUE (NAME) LENGTH (DATA-VALUE) [ITEM (DATA-AREA). [REWRITE] [MAIN | AUXILIARY] END-EXEC. REWRITE . Copyright: IBMMAINFRAMES. Main / Auxiliary .is used to rewrite the record identified by ITEM.To specify the storage medium.

NEXT .logical record in the TSQ. Item for direct access specify the item no of the record.AREA) LENGTH (DATA-VALUE) [ITEM (DATA-VALUE) | NEXT] [NUMREC (DATA-AREA)] END-EXEC.com 137 .to retrieve the next . Syntax EXEC CICS READQ TS QUEUE (NAME) INTO (DATA . mutually exclusive to the item option NUMREC the data area is defined as PIC 9(4) comp. Copyright: IBMMAINFRAMES.READQ TS Can be used to read records either sequentially or directly. of records in the TSQ. to find the Total no.

Copyright: IBMMAINFRAMES.DELETEQ TS of TSQ EXEC CICS DELETEQ TS QUEUE (NAME) END-EXEC. All associated storage is released.   All records is TSQ are deleted.com 138 .

Copyright: IBMMAINFRAMES.com 139 .specified is Queue id not found. Lengerr Length specified is greater than the maximum record length. (2) error Q iderr .EXCEPTIONAL CONDITIONS (1) Special handling required Itemerr Item number specified is not in the range of entry number assigned for the Queue.

com 140 .TESTING & HANDLING EXCEPTIONS Copyright: IBMMAINFRAMES.

Copyright: IBMMAINFRAMES.COMMANDS FOR TESTING APPLICATION PROGRAMS CECI (Command Level Interpreter) is a CICS .supplied transaction which browses Temporary Storage Queue (TSQ). it will execute the command.supplied transaction which performs syntax checking of a CICS command.  CEDF is a CICS .com 141  .  CEBR (Temporary Storage Browse) is a CICS .supplied transaction which monitors the execution of an application program as an interactive debugging aid. If the syntax is satisfied.

APPLICATION PROGRAM SUPPORT   RESP and NOHANDLE IGNORE CONDITION    HANDLE CONDITION HANDLE AID HANDLE ABEND Copyright: IBMMAINFRAMES.com 142 .

com 143 .  The first screen lists all the possible CICS commands.  Giving question mark (?) before the command requests a syntax check only. CECI SEND MAP (`SPOOMPO') MAPSET (`SPOOMSO') ERASE Copyright: IBMMAINFRAMES. type CECI with the CICS command to be interpreted. Ex. No execution.COMMAND LEVEL INTERPRETER  For invoking CECI.

BROWSING CICS QUEUES  CEBR can be invoked while you are already in the CEDF mode. TS queues are retained until purged. Copyright: IBMMAINFRAMES. Then. press PF12 key to invoke CEBR.com 144   . Help (PF1) give you a list of CEBR commands on the screen. CEBR allows to browse information in Temporary Storage (TS) queues. Press the PF5 key to display the working storage section.

Place the RESP option with the response filed in a command. Its function is similar to the return code in the batch program.Any exceptional condition Copyright: IBMMAINFRAMES.EXCEPTION HANDLING CICS to respond to exceptional conditions in one of three ways:  RESP option: The RESP option can be specified in any CICS command. where xxxx is the .Define a fullword binary field (S9(8)COMP) in the working storage section as a response field.NORMAL .com 145 . check the response code in the response field with DFHRESP (xxxx). After command execution. .

PARA GOTO GENERAL ..-) Erase Resp (WS-Resp) End-Exec.EXCEPTION HANDLING Ex.Storage Section 77 WS-RESP PIC S9 (8) COMP PROCEDURE DIVISION EXEC CICS SEND From (.com 146 .PARA If WS-RESP = DFHRESP (LENGERR) GO TO LENGERR . If WS-RESP = DFHRESP (NORMAL) GO TO NORMAL .PARA Copyright: IBMMAINFRAMES.: Working .

com 147 . EXEC CICS HANDLE CONDITION Condition (Label) [Condition (Label)] [Error (Label)] END-EXEC. Copyright: IBMMAINFRAMES.  IGNORE CONDITION This command causes no action to be taken if the condition specified occurs in the program.EXCEPTION HANDLING  HANDLE CONDITION This command is used to transfer control to the procedure label specified if the exceptional condition specified occurs. or EXEC CICS IGNORE CONDITION Condition [Condition] END-EXEC.

com 148 .Contd…  ABEND CODE If an exceptional condition occurs during execution of a CICS application program and if the program does not check the exceptional condition.EXCEPTION HANDLING INTRODUCTION . CICS may continue executing the program or terminate abnormally the execution of the program. depending on the exceptional condition and the command involved. Copyright: IBMMAINFRAMES.

com 149 .Contd… Application Program CICS-Maintained condition Table EXEC CICS HANDLE CONDITION END-EXEC CICS UPDATES CONDITIONS CONDITION INVREQ DUPREC ENDFILE EOF QIDERR ERROR EXEC CICS IGNORE CONDITION END-EXEC CICS UPDATES CONDITIONS Copyright: IBMMAINFRAMES.LOGICAL LEVELS .

com 150    SYSTEM DEFAULT . HANDLE CONDITION COMMANDS IGNORE CONDITION ABEND Copyright: IBMMAINFRAMES.OPTION FOR EXCEPTION HANDLING  CODE RESP keyword in commands: CHECK USERSUPPLIED FIELD IN WORKING .STORAGE. CODE NOHANDLE KEYWORD IN COMMANDS.

All Rights reserved.com Written By: Mcmillan . Reproduction or reusing without permission is strictly prohibited.COPYRIGHT This product is licensed to IBMMAINFRAMES. Copyrighted to: IBMMAINFRAMES.com.