Professional Documents
Culture Documents
TIL
1 ICIC010.2.SL
Objectives of the course To get an introduction to CICS and CICS`s working environment To learn to write programs effectively in CICS To learn to develop efficient CICS applications
ICIC010.2.SL
SESSION # 1
3 ICIC010.2.SL
Batch System
Input
V/S
Online System
Data from terminal. Random, concurrent. Can be entered as data arrive. Concurrent. Instant. I/O can be concurrent. Messages thrown to console, Updated files System log, Reports.
ICIC010.2.SL
Update Reserved during a job. Of file Other jobs have to wait. File I/O I/O must be in sequence. Output Printed reports,O/P files. reports O/P files
Batch System
Start of job Process mode
V/S
Online System
Operator (or OS) initiates Entering Trans-ID job. triggers the transaction. Single task & thread Multitask & Multithread Priority in job scheduling. Priority processing. Each transaction . Almost Instantaneous.
INTRODUCTION TO CICS
CICS is one of the most popular DB / DC (Data Base / Data Communication) Control System. Also, Also it is an Online Transaction Processor OLTP OLTP. Macro Level : Initial version of CICS was Macro Level, under which application programs used Assembler-macros f d hi h li i dA bl for requesting CICS services. This work was quite cumbersome & required special skills. q p Command Level : In the later upgraded version, CICS commands are high level language version of macros, one macros command achieves service achieved by series of macros.Development became more easier.
6 ICIC010.2.SL
Product CICS / MVS CICS / OSVS Ver. Ver 2 Release 1 Ver. 1 Release 7
FEATURES OF CICS
Easy to develop on-line applications. y p pp Common interface to database and Data sets. Better response time. Easy to customize. Coding similar to high level Languages. g g g g
Continued ...
8 ICIC010.2.SL
FEATURES OF CICS(Contd...)
No need to code for displaying data onto the screen. Easy forms development using BMS facility. Device independence. Data independence. Sharing of code between applications.
ICIC010.2.SL
CICS
Appln. Program
OPERATING SYSTEM D t b Database Access Method (DL/1,DB2) Data Storage CICS / MVS System Services Monitoring Functions Application Program Services Data Access Method (VSAM, BDAM) Telecommunication Access Method (VTAM, TCAM) Other S t Systems
Data-handling Functions
11
ICIC010.2.SL
VOCABULARY
Multi User Multi Tasking Multi Programming Multi Threading Job Task Transaction Reentrancy Q Quasi Reentrancy y
12
ICIC010.2.SL
MULTITASKING
Multitasking means that the operating system (OS) allows more than one task to be executed concurrently, regardless of whether the tasks use the same program or different p og a s. programs.
13
ICIC010.2.SL
MULTITHREADING
Multithreading is the system environment where the tasks are sharing the same program under the multitasking environment. Under the multithreading environment, a program is shared by several b se eral tasks conc rrentl For each task, the program concurrently. task must work as if it were executing instructions exclusively for each task.
14
ICIC010.2.SL
REENTRANCY
In order to make multithreading possible, an application program must be reentrant. A reentrant program is a program which does not modify itself so that th t it can reenter to itself and continue processing after an t t it lf d ti i ft interruption by the operating system.
15
ICIC010.2.SL
CICS COMPONENTS
Control Programs ( Management Modules) Control Tables Control Blocks CICS core nucleus consists of Control Programs & their corresponding Control Tables.
16
ICIC010.2.SL
Control Program
File Control Program Interval Control Program g Journal Control Program Program Control Program Task Control Program Storage C S Control P l Program Terminal Control Program
Control Tables
File Control Table Interval Control Table Journal Control Table Processing Program Table Program Control Table Storage C S Control T bl l Table Terminal Control Table
Temporary Storage Program Temporary Storage Table Transient Data Program Destination Control Table
17 ICIC010.2.SL
CONTROL BLOCKS
EXEC Interface Block (EIB) : CICS provides system related information to each task in the form of Exec interface block. Since the information is automatically provided by CICS the application program can use it straightaway. Some of th most commonly used EIB information are S f the t l d i f ti EIBAID : Value of last Attention identifier key pressed (1 BYTE ). Continued...
18 ICIC010.2.SL
EIBDATE
EIBFN
EIBRCODE
EIBTIME
EIBTRMID
EIBTRNID
20
ICIC010.2.SL
CICS STARTUP:
Starting up of an CICS system involves executing a job (JCL) like any other batch-job. j p y g ( ) Main job-step is System Initialization Program (SIP). SIP loads corresponding System Initialization Table (SIT), based on which SIP further loads all control programs and tables and performs initial house-keeping tasks.Then CICS is ready to execute CICS transactions within its own region.
CICS SHUTDOWN :
The computer operator terminates CICS job by entering Master Terminal Transaction (CEMT) with shut-down option. j p g, , p p Then CICS job produces various logs, statistics, dumps & reports
21 ICIC010.2.SL
23
ICIC010.2.SL
In addition to the above basic procedures, the detailed CICS p , system environment must be prepared properly by the system programmers or application programmers. For example : The terminal must be registered in the TCT. The CICS user identifier must be registered in the SNT. h id ifi b i di h ( , , ) prepared Other CICS tables (viz. FCT, JCT, DCT) must be p p for the application program, if required.
24
ICIC010.2.SL
Object Module
COBOL Compiler
Linker
There are five ways of initiating CICS transactions : 1. 1 By a transaction identifier entered in a terminal with ENTER key. 2. By a transaction identifier associated with a terminal for pseudo-conversation. 3. By the START command, which initiates a transaction specified in the p p parameter. 4. By the Automatic Task Initiation (ATI). 5. By a 3270 attention identifier. For an IBM 3270 type terminal any of the PF and PA keys could be defined in PCT to initiate a CICS transaction.
26
ICIC010.2.SL
USER ENTERS TRANS-ID (AAAA) PCT Transaction AAAA BBBB CCCC PPT Program AAAPGM1 BBBPGM1 CCCPGM2
Program AAAPGM1 BBBPGM1 CCCPGM2 CICS locates trans-id AAAA in program control table CICS Address Space Location On Disk In Storage g On Disk CICS locates program AAAPGM1 in the processing program table CICS locates load module AAAPGM1 on disk, loads it into memory, and starts the task
BBBPGM1
Library y
Load Module
AAAPGM1
27
ICIC010.2.SL
SIGN ON The primary function of CICS SIGN ON is to associate CICS user identifier with CICS system in terms of security, Priority and other functions. CESN or CSSN is CICS supplied transaction which prompts SIGN ON screen as shown. Complete SIGN ON by giving CICS/VS SIGNON correct USERID & PASSWORD enter userid Unless SIGN ON process is complete NO CICS transaction can USERID: be invoked. PASSWORD:
CICS SERVICES
Terminal Control Program Control File Control Basic Mapping Support ( B M S ) Transient Data & Temporary Storage Control Interval & Task Control Storage Control
29 ICIC010.2.SL
SESSION # 2
30 ICIC010.2.SL
INTRODUCTION
The CICS Terminal Control Program (TCP) provides communication services between application programs and terminals, using the information defined in the Terminal Control Table. Usually, unformatted screens are used for the T i l C t l O th Terminal Control Operations. ti
31
ICIC010.2.SL
CONVERSE
ISSUE PRINT To print all data onto the screen on printer ISSUE COPY To copy one terminal screen to other HANDLE AID T handle keys pressed on terminal To h dl k d t i l
32 ICIC010.2.SL
Eg: g:
EXEC CICS C C CS SEND FROM (Enter the Number ) LENGTH (20) END-EXEC. END EXEC EXEC CICS SEND FROM (SCR-MESSAGE) LENGTH (WS-MESSAGE-LEN) END-EXEC. (WS-MESSAGE-LEN is a WO (WS SS G N s WORKING-STORAGE v NG S O G variable ) be
33 ICIC010.2.SL
CONVERSE COMMAND
The CONVERSE Command performs the combined functions of the SEND command with Invite option and RECIEVE command. command The CONVERSE command sends data to other partner transaction during the conversation, automatically switches the t ti d i th ti t ti ll it h th communication state from the send state to receive state, inviting the other partner transaction to send the data and then receives data from other partner transaction. This CONVERSE command is used in Inter System Communication type of Intercommunication . Continued... C ti d
35 ICIC010.2.SL
37
ICIC010.2.SL
38
ICIC010.2.SL
Eg:
40
ICIC010.2.SL
41
ICIC010.2.SL
PROGRAM CONTROL
SESSION # 3
42 ICIC010.2.SL
43
ICIC010.2.SL
PROGRAM CONTROL
Program Control Program is responsible for managing the use of all application programs The PCP uses the information available in PPT to manage the flow of control between programs
44
ICIC010.2.SL
Program 1 g
Working-storage Section
Program 2
Linkage Section. DFHCOMMAREA
ICIC010.2.SL
COMMANDS FOR PROGRAM CONTROL LOAD Load a program into the CICS address space RELEASE Release the program from CICS address space LINK Call another program at the lower logical level XCTL Transfer control to another program at the same logical level RETURN Return to i immediate higher logical level di hi h l i l l l
47
ICIC010.2.SL
LOAD command
The LOAD Command is used to load a program or table which is independently compiled or assembled & link-edited and registered in PPT . i di This command is useful for loading a table or application g program dynamically. That is, as an application, a table can be coded in Assembler, assembled and link-edited. Then COBOL program can load it as a table. table Continued...
48 ICIC010.2.SL
49
ICIC010.2.SL
Important Parameters :
PROGRAM - Program to be loaded into CICS address space SET Pointer reference to the address of Table/Program/Map LENGTH S9(4) COMP. Length of module (if length < 32 k) FLENGTH S9(8) COMP. (if length > 32 k) HOLD Module resident in memory even when task terminates Module
50
ICIC010.2.SL
LOAD command
Example: EXEC CICS LOAD PROGRAM (lodprg) SET (ptrvar) LENGTH (l (lenvar) ) END-EXEC . Exceptions: PGMIDERR Program not found LENGERR Load module > 32 K NOAUTH Security check error
51
ICIC010.2.SL
RELEASE command
Release Command is used to release a program or table which has been loaded previously previously. Name of program must be specified in PROGRAM parameter. t
52
ICIC010.2.SL
EXEC CICS RELEASE PROGRAM ( G (Program Name) ) END-EXEC. Parameters : PROGRAM - Name of the program to be released
53
ICIC010.2.SL
LINK command d
The LINK Command is used to pass Control from an application program at one logical level to another application program at the next lower logical level. level The calling program expects control to be returned to it. Data can be passed to the called program through communication area parameter called COMMAREA. This command is the equivalent of CALL in COBOL.
54
ICIC010.2.SL
55
ICIC010.2.SL
56
ICIC010.2.SL
CICS SYSTEM
57
ICIC010.2.SL
XCTL command d
The XCTL Command is used to pass control from a p application program to another application program at the same logical level. It does not expect control to be returned. Like LINK, in this command also, data can be passed through COMMAREA to the called program. This command is similar to the CHAIN command in COBOL.
58
ICIC010.2.SL
EXEC CICS XCTL PROGRAM (Program Name) COMMAREA (Data-Area) LENGTH (L ) (Len) INPUTMSG (Data-Area) INPUTMSGLEN (Len) END-EXEC.
59
ICIC010.2.SL
- Program to be XCTLed. g - Data area to be passed to the called program - S9(4) COMP. Length of data area to be COMP passed - Data area to be passed to the called program as an i input - S9(4) COMP. Length of data area to be p passed as input p
60 ICIC010.2.SL
CICS SYSTEM
61
ICIC010.2.SL
62
ICIC010.2.SL
EXEC CICS RETURN TRANSID (TRNID) COMMAREA (Commarea) LENGTH (Length of Commarea) IMMEDIATE INPUTMSG (Data-Area) INPUTMSGLEN (Len) ( ) END-EXEC.
63
ICIC010.2.SL
65
ICIC010.2.SL
Continued... Continued
66 ICIC010.2.SL
67
ICIC010.2.SL
Data related entries cannot be used in ENVIRONMENT DIVISION & DATA DIVISION. Following statements in COBOL cannot be used in CICS. IDENTIFICATION DIVISION No restrictions ENVIRONMENT DIVISION SELECT Statement Continued...
68 ICIC010.2.SL
DATA DIVISION FD E t Entry REPORT SECTION PROCEDURE DIVISION SORT RELEASE RETURN Debugging Statements EXHIBIT TRACE Continued...
69 ICIC010.2.SL
RESTRICTIONS in COBOL when using CICS PROCEDURE DIVISION I/O Statements ACCEPT DISPLAY File Handling commands OPEN CLOSE READ WRITE REWRITE DELETE Continued...
70 ICIC010.2.SL
PROCEDURE DIVISION Program Termination commands STOP RUN EXIT PROGRAM GOBACK String Handling statements STRING UNSTRING INSPECT EXAMINE Continued...
71 ICIC010.2.SL
72
ICIC010.2.SL
FILE CONTROL
SESSION # 4
73 ICIC010.2.SL
INTRODUCTION
The CICS File Control Program (FCP) provides application programs with services to Read Update Add and Read, Update, Add, Delete records in a file (dataset). In addition it makes application programs independent of the structure of the database, while it manages exclusive control over the records, in order to maintain the data integrity during record updates. CICS supports the following VSAM Datasets : LDS : Linear Data Set ESDS : Entry Sequenced Data Set KSDS : Key Sequenced Data Set RRDS : Relative Record Data Set Continued...
74 ICIC010.2.SL
REWRITE : Update a Record DELETE : Delete a Record UNLOCK : To release Exclusive control acquired for update
77 ICIC010.2.SL
EXAMPLE
Suppose that file FILEAAA has records in the following order : BO001 BC001 DC001 DC002 NY000 NY001 NY002 PH001 PH002
79 ICIC010.2.SL
WORKING-STORAGE SECTION. 77 WK-LEN 01 FILE-IOAREA. FILE IOAREA. 05 REC-A. 10 REC-A-KEY 15 REC-A-KEY-CITY 15 REC-A-KEY-SEQ Q 10 REC-A-DETAIL . . PROCEDURE DIVISION. MOVE 35 TO WK-LEN. MOVE NY001 TO REC-A-KEY. EXEC CICS READ DATASET(FILEAAA) INTO(FILE-IOAREA) RIDFLD(REC-A-KEY) LENGTH(WK-LEN) ( ) END-EXEC.
80
ICIC010.2.SL
81
ICIC010.2.SL
REWRITE COMMAND
A combination of the READ command with the UPDATE option and the REWRITE command is used to update a record. Between these two commands, exclusive control over the record will be maintained for this task, so that no other task can access this record for update.
82
ICIC010.2.SL
83
ICIC010.2.SL
86
ICIC010.2.SL
BROWSE COMMANDS
CICS provides a special set of browse commands STARTBR READNEXT READPREV RESETBR ENDBR Continued...
87 ICIC010.2.SL
4. If processing of the record is required, then process and go to step 3. 5. 5 If more records are required, d i d then go to step 3. 6. If it is required to establish another position, then restablish the new position and go to step 3. RESETBR 7. Terminate the BROWSE operation. ENDBR 8. End.
88 ICIC010.2.SL
90
ICIC010.2.SL
91
ICIC010.2.SL
92
ICIC010.2.SL
93
ICIC010.2.SL
SESSION # 5
94 ICIC010.2.SL
95
ICIC010.2.SL
IBM TERMINALS
The CICS Terminal Control Program(TCP) provides communication services between i i i b user-written applications and , g terminals, using information defined in the Terminal Control Table (TCT).
96
ICIC010.2.SL
IBM TERMINALS
Many types terminals are supported by CICS for data communication. A few examples.... p IBM 3270 Information Display System IBM 3600 Finance Communication System IBM 8775 Advanced terminals Normally, 3270 are the most commonly used terminals N ll h l d i l with Mainframes
97
ICIC010.2.SL
IBM TERMINALS
To communicate with any of these terminals, the data should be sent in their native mode. i.e., they must receive data stream in their native mode called Native Mode Data Stream (NMDS). NMDS is mixture of Buffer Control characters and Text data which is unique for individual terminal types based on their hardware protocol. protocol
98
ICIC010.2.SL
C Info.
Addr
SF
Text Data
C. Info Addr
Text Data
C Info Info.
Field 1
Field 2..... 2
IBM TERMINALS
Problems with NMDS are that it is... Device Dependent (Hardware specific) Format Dependent Difficult to code To make the application programs independent k h li i i d d of terminal hardware we go for device and format independent Basic Mapping Support, p pp g pp , shortly BMS.
100
ICIC010.2.SL
BMS is an interface between the application program and the terminal BMS maps device independent data into device dependant data to provide a formatted screen d d td t t id f tt d BMS identifies the location and characteristics of data fields as well as the characteristics of the terminal with which the map will be used
FUNCTIONS OF BMS
To remove device dependent codes and constant information from an application and to place them in maps thereby simplifying programming job. Keeps Code largely independent of Any changes in network of terminals Any changes in the terminal types Other functions include... Processing text Page building Multiple screens of data Message Routing
102 ICIC010.2.SL
103
ICIC010.2.SL
TYPES OF MAPS
PHYSICAL MAP S CA A It is a program in the form of a load p g module. It is a table equivalent of screen layout layout. It resides in the program load library. It is loaded when executing program q requests send/receive BMS services.
104 ICIC010.2.SL
TYPES OF MAPS
SYMBOLIC MAP It is a group structure of COBOL variable declaration for map fields. It resides in the COPY books library. It is copied into the source program by p p g y the compiler during compilation of CICS application program.
105 ICIC010.2.SL
GENERATION OF MAPS
BMS Macro ASSEMBLE Link - Edit
Symbolic Map
Physical Map
COPY LIB
LOAD LIB
106
ICIC010.2.SL
Link Edit
107
ICIC010.2.SL
Name N
Operation O ti
Operands O d
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 .... 70 71 72
108
ICIC010.2.SL
109
ICIC010.2.SL
DFHMSD
This Operation denotes that the definitions are for a Mapset and defines the mapset properties which consists of one or more maps. The Operands, apart form other things, specify whether the program will generate physical maps or symbolic maps or both h i l b li b th while assembling the code specify whether the maps will be used as I/P, O/P or both Continued...
111 ICIC010.2.SL
DFHMSD Syntax
MAPSETA DFHMSD TYPE = | DSECT / MAP / FINAL |, // DSECT-Symbolic Map MAP- Physical Map Final-Last map MODE MODE= | IN / OUT / INOUT ||, // Specifies Input / Output / Input Output Mode LANG = |ASM / COBOL / PL1 |, // Specifies the host language S ifi th h t l TERM = |ALL / 3270 |, // Terminal type ALL if supports all / 3270 IBM terminal STORAGE = AUTO // Each map will have separate storage area TIOAPFX = | YES / NO | , // If YES puts filler(12) for control info. CTRL=(PRINT,FREEKB,ALARM) // PRINT -Hard copy / FREEKB F H d FREEKB- Frees kbd ALARM kbd. ALARM-sound it d
112 ICIC010.2.SL
DFHMDI
This Operation denotes that the definitions are for a Map and defines the Map properties which consists of one or more fields fields. The Operands, apart form other things, specify the size and position of the map on the screen
Continued... Continued
113 ICIC010.2.SL
DFHMDI Syntax
Mapname DFHMDI
114
ICIC010.2.SL
DFHMDF
This Operation denotes that the definitions are for a Field within a Map. The O Th Operands, apart form other things, d tf th thi specify the length and relative position of the field on the map specify the attributes of the field specify the default values for the field specify whether the field is part of a group variable or not, etc.
115
ICIC010.2.SL
DFHMDF Syntax
Fieldname DFHMDF POS=(LINE,COLUMN), //Specifies position in the Map. LENGTH <1 LENGTH=<1 TO 255>, 255> // Specifies Size INITIAL=<value>, // Initialize text GROUPNAME=<GROUPNAME>, //Allows Subdivision of field //All S bdi i i f fi ld PICIN = <pic_clause>, PICOUT = <pic_clause>, // For formatting fields E.g. : $99.99 / 999.99DB JUSTIFY=|LEFT/BLANK/RIGHT/ZERO|, OCCURS <Number_of_Occurrences>, OCCURS= <Number of Occurrences> ATTRB=(attr1,attr2) //Specifies characteristics of field
116 ICIC010.2.SL
DFHMDF ATTRIBUTES
1. ASKIP / PROT / UNPROT //Specifies Auto-skip / Protected / Unprotected field 2. IC // Insert Cursor initializes cursor position 3. BRT / NORM / DRK // Bright / Normal / Dark Intensity of field 4. NUM // Numeric field type 5. FSET //Field Set (MDT ON) 6. DET // PEN Detectable
117
ICIC010.2.SL
118
ICIC010.2.SL
Sample BMS Coding... 1 10 1617 MAPSETA DFHMSD TYPE=MAP,MODE=INOUT, X CTRL=(FREEKB,FRSET), LANG=COBOL,TERM=3270 MAP1 DFHMDI SIZE=(24,80),TIOAPFX=Y DFHMDF POS=(1,10),LENGTH=6, INITIAL = T I L. DATE DFHMDF POS=(1,20),LENGTH=8 POS (1 20) LENGTH 8 DFHMDF POS=(3,10),LENGTH=10, INITIAL=ENTER NAME NAME DFHMDF POS=(3,25),LENGTH=20, POS=(3 25) LENGTH=20 ATTRB = IC MAP2 ...... MAP3 ......
72 X
X X
SYMBOLIC MAP
PHYSICAL MAP
PHYSICAL MAP
SYMBOLIC MAP
....
124 ICIC010.2.SL
EXCEPTION HANDLING
SESSION # 6
126 ICIC010.2.SL
127
ICIC010.2.SL
RESP OPTION
The RESP option can be specified in any CICS command. Its function is similar to the return code in a batch program. If the RESP option is specified in a command , CICS places a response code at the completion of the command. The application program can check this code, then proceed to the next processing. This Thi approach has an advantage over the HANDLE hh d t th CONDITION approach, because this makes the program more structured.
128
ICIC010.2.SL
The following is the procedure to use the RESP option in a CICS g p p command : 1. 1 Define a fullword binary field (S9(8) COMP) in the Working Storage Section as the response field. 2. Place the RESP option with the response field in a command. 2 Pl h i ih h fi ld i d p 3. After command execution, check the response code in the response field with DFHRESP(xxxx), where xxxx is : NORMAL for normal completion. A exceptional comdition. Any ti l diti
129
ICIC010.2.SL
Example : WORKING-STORAGE SECTION WORKING STORAGE SECTION. 77 WS-RETCODE PIC S9(8) COMP. PROCEDURE DIVISION. . . EXEC CICS SEND FROM (_____) LENGTH(___) LENGTH( ) ERASE RESP(WS-RETCODE) END-EXEC. . IF WS-RETCODE = DFHRESP(NORMAL) GO TO NORMAL-PARA. IF WS-RETCODE = DFHRESP(LENGERR) GO TO LENGERR-PARA LENGERR-PARA. GO TO GENERAL-ERR-PARA. NORMAL-PARA. LENGERR PARA. LENGERR-PARA
130
ICIC010.2.SL
During the execution of this program, the following will occur : At the completion of the SEND command, the WS-RETCODE field will have the response code of the command execution result. result If the SEND command completes normally, control will be passed to NORMAL-PARA. If a LENGERR is e cou e ed , control will be passed to NG s encountered co o w p ssed o LENGERR-PARA. If any other exceptional condition is encountered, control will be encountered passed to GENERAL-ERR-PARA.
131
ICIC010.2.SL
132
ICIC010.2.SL
EXAMPLE
EXEC CICS HANDLE CONDITION ERROR(GEN-ERR-RTN) LENGERR(LENGERR-RTN) END-EXEC. EXEC CICS RECEIVE INTO(WK-TIOA) INTO(WK TIOA) LENGTH(WK-LEN) END-EXEC. ...... LENGERR-RTN. ........................................ GEN-ERR-RTN. .............................................
133 ICIC010.2.SL
The IGNORE CONDITION command causes no action to be taken if the specified condition occurs in the p g p program. The control will be passed on to the instruction following the command which encountered the exceptional condition. The request by the IGNORE CONDITION command is valid until the subsequent HANDLE CONDITION for the same condition. diti
134
ICIC010.2.SL
Syntax : EXEC CICS IGNORE CONDITION condition (condition) END-EXEC. The condition indicates an exceptional condition. At the most, only 12 conditions are allowed in the same command.
135
ICIC010.2.SL
EXAMPLE
EXEC CICS IGNORE CONDITION LENGERR END-EXEC. END EXEC EXEC CICS RECEIVE INTO(_______) LENGTH(____) END-EXEC.
At the execution of the RECEIVE command, if LENGERR command exception occurs, the condition will be ignored, and the control will be passed to the statement after the RECEIVE command.
136 ICIC010.2.SL
137
ICIC010.2.SL
EXAMPLE
EXEC CICS HANDLE AID PF3(END-ROUTINE) 3( N OU N ) PA1(CANCEL-ROUTINE) ENTER(NORMAL-ROUTINE) ANYKEY(WRONG-KEY-ROUTINE) ANYKEY(WRONG KEY ROUTINE) END-EXEC.
138
ICIC010.2.SL
The Th HANDLE ABEND command i used t i t d is d to intercept an t abnormal termination (ABEND) in a program, and to activate, cancel or reactivate an exit for the ABEND processing. The HANDLE CONDITION command intercepts the abnormal conditions of the CICS command execution whereas HANDLE ABEND intercepts abnormal termination.
139
ICIC010.2.SL
Syntax : EXEC CICS HANDLE ABEND [PROGRAM(name) | LABEL(label) | CANCEL | RESET ] END-EXEC. PROGRAM or LABEL is used to pass control to a program or a sed paragraph , respectively, for ABEND processing. CANCEL is used to cancel the previously established HANDLE ABEND request. RESET is used to reactivate the previously cancelled HANDLE ABEND request.
140 ICIC010.2.SL
EXAMPLE
WORKING-STORAGE SECTION WORKING STORAGE SECTION. 77 MSG-LEN PIC S9(4) COMP. 01 MSG-DATA. 05 MSG-DATA1 PIC X(15). 05 MSG DATA2 PIC X(50). MSG-DATA2 X(50) : PROCEDURE DIVISION. : EXEC CICS HANDLE ABEND LABEL(ABEND-ROUTINE) END-EXEC. : ABEND-ROUTINE. ABEND ROUTINE MOVE ABEND OCCURED. TO MSG-DATA1. MOVE TASK CANCELLED WITH ABCODE 9999. TO MSG-DATA2. MOVE 65 TO MSG-LEN. EXEC CICS SEND FROM (MSG-DATA) LENGTH(MSG-LEN) NOHANDLE END-EXEC. END EXEC
141
ICIC010.2.SL
EXEC CICS HANDLE ABEND CANCEL END-EXEC. END EXEC EXEC CICS ABEND ABCODE(9999) END-EXEC.
During the execution of the program, the following activities will occur : If an ABEND occurs, it will be intercepted by the HANDLE ABEND command, and control will be passed to ABENDROUTINE. ROUTINE At the completion of the HANDLE ABEND/CANCEL command, the previous HANDLE ABEND request will be cancelled. At th completion of the ABEND command, th task will be the l ti f th d the t k ill b terminated with user code 9999.
142
ICIC010.2.SL
SESSION # 7
143 ICIC010.2.SL
144
ICIC010.2.SL
146
ICIC010.2.SL
Continued ...
151 ICIC010.2.SL
152
ICIC010.2.SL
DELETEQ TD - To delete an Intra Partition TDQ Not Valid for Extra Partition TDQ TD in the commands stands for Transient Data ; if omitted the same command defaults to TSQ i d h dd f l
153
ICIC010.2.SL
- DCT entry not found for the Q - l length specified is greater than h ifi d i h maximum length given in DCT - no space available in TDQ p Q
154 ICIC010.2.SL
- DCT entry not found for the Q - l length specified is not the same h ifi d i h as that specified in DCT - no more items to read in the Q Q
155 ICIC010.2.SL
156
ICIC010.2.SL
157
ICIC010.2.SL
159
ICIC010.2.SL
SESSION # 8
160 ICIC010.2.SL
164
ICIC010.2.SL
EXAMPLE
WORKING STORAGE WORKING-STORAGE SECTION. 01 TSQ-QID. 05 TSQ-QID-DIV 05 TSQ-QID-TERM 05 TSQ QID APPL TSQ-QID-APPL 05 TSQ-QID-NUM 01 TSQ-DATA. 05 TSQ-FIELD1 05 TSQ FIELD2 TSQ-FIELD2 77 TSQ-LEN 77 TSQ-ITEM PROCEDURE DIVISION. OC U V S ON. .................... CONSTRUCT QID. MOVE EIBTRMID TO TSQ-QID-TERM. MOVE I TO TSQ-QID-APPL. QQ MOVE 1 TO TSQ-QID-NUM. ...................(Edit TSQ data).................. MOVE 200 TO TSQ-LEN. Contd............... PIC X VALUE A. PIC X(4). PIC X. PIC 99. PIC X(50). PIC X(150). PIC S9(4) COMP. PIC S9(4) COMP.
165
ICIC010.2.SL
EXAMPLE ........(Contd.)
WRITE A QUEUE. EXEC CICS WRITEQ QUEUE(TSQ-QID) FROM(TSQ-DATA) LENGTH(TSQ-LEN) ITEM(TSQ-ITEM) ITEM(TSQ ITEM) MAIN END-EXEC.
N.B. : If a TSQ with this QID does nort exist, a TSQ will be created with QID=AttttI01, where tttt is the terminal id.
166
ICIC010.2.SL
SESSION # 9
167 ICIC010.2.SL
OBJECTIVES To know more on Interval Control and Time related functions To know more on Task management
168
ICIC010.2.SL
INTERVAL CONTROL
CICS Interval Control Program ( ICP ) provides application program a variety of time related functions, such as current date & time, ATI of time ordered tasks etc. There are specific commands available for CICS-ICP to handle with the time and date functions.
169
ICIC010.2.SL
INTERVAL CONTROL
A few ICP Commands... ASKTIME to request Current Date & Time i FORMATTIME- to select Format of Date & Time DELAY to Delay processing of a task yp g WAIT EVENT - to wait for an event to occur START to start a Transaction POST to request notification when specified time has expired RETRIEVE - to retrieve data stored by START command f the transaction d for h i CANCEL to cancel effect of previous interval control command
170 ICIC010.2.SL
INTERVAL CONTROL
VARIOUS DATE / TIME FORMATS DDMMYY / MMYYDD / YYMMDD / YYDDD DATE / DATESEP / DATEFORM YEAR TIME / TIMESEP DAYOFWEEK / DAYOFMONTH A O A O O DAYCOUNT MONTHOFYEAR NOTE : In the latest release of CICS, year is in YYYY format
171 ICIC010.2.SL
INTERVAL CONTROL
Scheduled Transaction Initiation (STI) ( ) Scheduled Transaction Initiation (STI) is an important application of the START command, by which CICS transactions can be initiated automatically at scheduled time or intervals. intervals EXEC CICS START TRANID(ABCD) TERMID(TTTT) TIME( 090000 ) ( END-EXEC. // ABCD will be initiated at 9.00 AM
172
ICIC010.2.SL
TASK CONTROL
CICS Task Control Program ( KCP ) provides functions to synchronize task activities and to gain exclusive control over resources In other words TASK CONTROL refers to the CICS g functions that manage the execution of tasks It is mainly concerned with the task dispatcher that dispatches the tasks according to priority CICS automatically provides exclusive control over resources to a task in most of the cases. However for certain sharable resources ENQ & DEQ should be used for maintaining integrity, like for TSQ updating, Printer Handling etc.,
173
ICIC010.2.SL
TASK CONTROL
A few KCP Commands... ENQ to gain exclusive control over resource to l t release resource on exclusive l i control
DEQ -
174
ICIC010.2.SL
INTERCOMMUNICATION
SESSION # 10
175 ICIC010.2.SL
176
ICIC010.2.SL
INTER COMMUNICATION
CICS Inter Communication is a concept of communicating between various Sub-Systems and CICS in a MultiSystem environment The term Various Sub-Systems include Various Sub Systems other CICS regions in the same processor CICS region in other processors and even non-CICS regions CICS i Inter Communication can be achieved in two ways... Multi Region Operation ( MRO ) Inter System Communication ( ISC )
177
ICIC010.2.SL
In any system, there could be more than one CICS region, each running independently under same OS say MVS/XA, on the same processor Communication between CICS regions in the C i ti b t i i th same environment under the same processor is termed as MRO
178
ICIC010.2.SL
Accounting database d t b
Operating System Accounting System CICS 1 S t Sales System CICS 3 Inventory System CICS 2
Sales database
179
Inventory database
ICIC010.2.SL
Disadvantages
In MRO all operations must be centralized (more specifically in Uni.-Processor) and h ifi ll i U i P ) d hence MRO is not suitable for distributed applications (Spanning several offices/ processors)
182
ICIC010.2.SL
184
ICIC010.2.SL
Accounting database
CITY 1
Operating System
SNA
CITY 2
Sales database
185
CITY 3
Inventory database
ICIC010.2.SL
SESSION # 11
186 ICIC010.2.SL
OBJECTIVES To know more about diagnostic facilities in CICS To learn to use CEDF
187
ICIC010.2.SL
DEBUGGING UTILITIES
Other CICS supplied debugging utilities include pp gg g Transaction Dump Command Level Interpreter ( CECI ) Temporary S Storage Browse (C CEBR )
188
ICIC010.2.SL
SESSION # 12
190 ICIC010.2.SL
OBJECTIVES
191
ICIC010.2.SL
Considerations to be made while designing an ON - LINE application Processing Requirements Screen requirements On-Line printing requirements Continued ...
192 ICIC010.2.SL
Considerations to be made while designing an ON - LINE application (cont ) (cont.) User Friendliness System performance and Resource usage System security, reliability and maintainability
193
ICIC010.2.SL
Reduce traffic on the line where ever possible While browsing files, avoid Multi Files Browsing Learn to use GENERIC key option. - END 196 ICIC010.2.SL