Professional Documents
Culture Documents
Course Mechanics
Course Type: Facilitated
Course Notes:
Notes are located in the Notes View. (Please see View Master/Notes Master to see the Notes View.)
Course Audience: Team Members or Project Managers with exposure to Mainframe Technology
23 August 2013
CICS.ppt
Prerequisite Training
23 August 2013
CICS.ppt
Course Objectives
Participants will be able to learn and work on CICS Application Programming
23 August 2013
CICS.ppt
Agenda
Introduction to CICS Program Preparation Program Control Basic Mapping Support Error & Exception Handling File Handling Queues
CICS allows you to take existing applications to the web with little or no change
CICS supports numerous application development environments and models including COBOL, PL/I, Java, EJB and Object Oriented (OO), in any combination
23 August 2013
CICS.ppt
Introduction 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
23 August 2013
CICS.ppt
10
Introduction
Operating System
CICS
Enter Code :
Users App.Prg
23 August 2013
CICS.ppt
11
Introduction
DB/DC System Data Base
Central System
23 August 2013
CICS.ppt
12
System Services
Monitoring Functions
23 August 2013
CICS.ppt
13
Quasi-Reentrancy
23 August 2013
CICS.ppt
14
Introduction Task
A basic unit of work which is scheduled by the operating system or CICS - Read from and write to the terminal
- Read and write files - Starting another task etc...
Transaction
An entity which initiates execution of a task. In CICS, transaction is identified by the transaction identifier
23 August 2013 CICS.ppt 15
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
23 August 2013 CICS.ppt 16
:
FIRST-PROCESS. EXEC CICS RECEIVE ---- <= TSK1,12345 END-EXEC.
: process
EXEC CICS SEND END-EXEC. * - - - - - - Program Waits For Response - - - - ----- <= EMP(12345) Details
SECOND PROCESS.
EXEC CICS RECEIVE ----- <= END-EXEC. : process
23 August 2013 CICS.ppt 17
END-EXEC.
: EXEC CICS SEND END-EXEC. EXEC CICS RETURN TRANSID (TSK2) END-EXEC.
23 August 2013 CICS.ppt
END-EXEC.
: EXEC CICS SEND END-EXEC. EXEC CICS RETURN END-EXEC.
18
Control Tables
- Define the CICS environment - Functionally associated with the management module
Control Blocks
- Contain system type information. Eg. Task Control Area contains info. about the task
23 August 2013 CICS.ppt 19
Tables
Processing Pgm File Control Terminal Control Program Control Temp. Storage Destin. Control Resource Control PPT FCT TCT PCT TST DCT RCT
Transient Data
Interval Control Journal Control
23 August 2013
TDP
ICP JCP
CICS.ppt
20
23 August 2013
CICS.ppt
21
DATA DIVISION. <== FILE SECTION IS OMITTED WORKING-STORAGE SECTION. 77 ----------------01 ----------------05 -------LINKAGE SECTION. <== LINKAGE SECTION IS MANDATORY 01 DFHCOMMAREA <== COMMUNICATION AREA reqd for passing data for subsequent execs. PROCEDURE DIVISON. (COBOL STATEMENTS)+ <== CICS statements mixed with COBOL statements (CICS STATEMENTS) Some COBOL verbs are not allowed
GO BACK.
23 August 2013 CICS.ppt 23
Introduction
Data between transactions - COMMAREA
First Execution- TXN1 Communication Area Maintained by CICS
..
EXEC CICS RETURN TRANSID(TXN1) COMMAREA(WS-COMM-AREA) END-EXEC.
23 August 2013 CICS.ppt
Starting a Task
PCT Trans TXN1
T X C1 TXC2 TXN1 TXN2
Program
MAPPGC1 MAPPGC2 TXNPGM1 TXNPGM2
PPT Program
MAPPGC1 MAPPGC2 TXNPGM1 TXNPGM2
Location
In Storage On Disk In Storage On Disk
TXNPGM1
Load Module
MAPPGC1 MAPPGC2 TXNPGM1 TXNPGM2
Library
MAPLIB MAPLIB PGMLIB PGMLIB
23 August 2013
CICS.ppt
26
PPT
PCT
TCT
LOADLIB
APPLICATION PROGRAM
TIOA
TCA
23 August 2013
CICS.ppt
27
ACCT
3 Account File
23 August 2013
CICS.ppt
28
Introduction Summary
Whats special about CICS
Batch & Online - Differences System Services Programming concepts Task & Transaction Terminal Conversation CICS Components Control Tables and Programs CICS Program Considerations & Restrictions
23 August 2013
CICS.ppt
31
23 August 2013
CICS.ppt
32
Program Preparation
Source Program
Translate
Translated Source
Translator Listing
Compile
Compiler Listing
Load Module
Link Edit
Object Module
23 August 2013
CICS.ppt
33
23 August 2013
CICS.ppt
35
23 August 2013
CICS.ppt
36
23 August 2013
CICS.ppt
37
23 August 2013
CICS.ppt
38
Defining a Program
Executing a Program
CICS sign on & CICS sign off Temporary Storage Browse CICS Command Level Interprets Master Terminal Transaction Resource Definition Online Execution Diagnostic Facility
23 August 2013
CICS.ppt
40
Program Control
CICS
Level 0 Level 1
Level 2
PROG B XCTL
PROG D XCTL
PROG E RETURN
42
23 August 2013
CICS.ppt
43
[LENGTH(data-value)]]
END-EXEC
23 August 2013
CICS.ppt
44
23 August 2013
CICS.ppt
45
23 August 2013
CICS.ppt
46
23 August 2013
CICS.ppt
47
[LENGTH(data-value)]]]
END-EXEC
23 August 2013
CICS.ppt
48
INVOICE-NUMBER
23 August 2013
CICS.ppt
49
FREEMAIN
23 August 2013
CICS.ppt
50
[CICSDATAKEY | USERDATAKEY]
[SHARED | INITIMG] END-EXEC
23 August 2013
CICS.ppt
52
DATAPOINTER(pointer)
END-EXEC
23 August 2013
CICS.ppt
53
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 54
23 August 2013
CICS.ppt
56
23 August 2013
CICS.ppt
57
Constant field(protected)
:
:
XXXXXXXX
XXXXXXXXXX Message field
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX F1 = Help
23 August 2013
F3=Exit
F12=Cancel
CICS.ppt 58
Assignment
Help Exit Backward / Prev Forward / Next Cancel Erase any data on the screen Unassigned (for program specific needs)
Field Attributes
Protection
Unprotected / Protected / Auto-Skip Shift
Alphanumeric / Numeric
Intensity Normal / Bright / Dark (No-display)
23 August 2013 CICS.ppt 60
01
23
Depends on 2 7 contents
00 Unprotected alphanumeric 01 Unprotected Numeric 10 Protected 11 Protected skip
45
Intensity
11 Dark (No-display)
6 7
23 August 2013
MDT
CICS.ppt
Options
Blue, Red, Pink, Green, Turquoise, Yellow, Neutral
Extended highlighting
Validation
23 August 2013
CICS.ppt
62
Symbolic Maps
Symbolic Map is a map used by Application Program (DSECT) Ensure device and format independence in the application program
23 August 2013 CICS.ppt 63
Assembler
Physical MAP Symbolic MAP Linkage editor
Multimap Panel
Dynamically constructing a screen panel with multiple maps at the execution time
23 August 2013 CICS.ppt 65
DFHMDI
DFHMDF DFHMSD TYPE = FINAL
23 August 2013
CICS.ppt
66
TIOAPFX={YES | NO}
DFHMSD
23 August 2013
TYPE=FINAL
CICS.ppt 67
CTRL=(option,option,) X JUSTIFY=LEFT/RIGHT
23 August 2013
CICS.ppt
68
GRPNAME=data-name
23 August 2013
CICS.ppt
69
23 August 2013
CICS.ppt
70
STORAGE=AUTO,SUFFIX=C
TULMAP DFHMDI SIZE=(12,60),CTRL=(FREEKB,ALARM,FRSET), COLUMN=1,LINE=1,DATA=FIELD, TIOAPFX=YES,JUSTIFY=(LEFT,FIRST) DFHMDF POS=(3,14),LENGTH=6,INITIAL='Name:', ATTRB=(PROT,NORM) NAME DFHMDF POS=(3,21),LENGTH=10,ATTRB=(UNPROT,BRT,ASKIP) DFHMDF POS=(3,32),LENGTH=1,ATTRB=(PROT,NORM) DFHMDF POS=(4,14),LENGTH=6,INITIAL='Age :', * * * *
ATTRB=(PROT,NORM)
AGE DFHMDF POS=(4,21),LENGTH=3, ATTRB=(UNPROT,NORM), DFHMDF POS=(4,25),LENGTH=1,ATTRB=(PROT,NORM) DFHMSD TYPE=FINAL
23 August 2013 CICS.ppt 71
02 FILLER
02 EMPNAL 02 EMPNAF
PIC X(12).
PIC S9(4) COMP. PIC X.
23 August 2013
CICS.ppt
73
[ MAPSET(mapsetname) ]
[ RESP() ] ] END-EXEC
Handle Conditions:
EODS, INVMPSZ, INVREQ, MAPFAIL
23 August 2013
CICS.ppt
75
23 August 2013
CICS.ppt
76
Conditions : INVREQ
CICS.ppt 77
Menu Screen
File
Control
Account File
6 8 BMS
23 August 2013
Program ACCT01
CICS.ppt
79
AID Keys
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 80
Take no action & let the program continue Control returns to the next inst. following the command A return code is set in EIBRESP and EIBRCODE
23 August 2013
CICS.ppt
82
Remains active while the program is executing or until it encounters IGNORE/another HANDLE cond.
EXEC CICS HANDLE CONDITION ERROR(ERRHANDL) DUPREC(DUPRTN) LENGERR This example handles DUPREC cond. separately, all the other ERRORs together. LENGERR will be handled by system
23 August 2013 CICS.ppt 83
ITEMERR
LENGERR END-EXEC
This command will not take any actions if the given two error occurs and will pass the control to the next instruction
23 August 2013 CICS.ppt 84
23 August 2013
CICS.ppt
85
Error & Exception Handling RESP option Let the program continue
Command response available in EIBRESP Made available in RESP option for each command Better structured code than HANDLE condition Implies NOHANDLE option whenever used
WORKING STORAGE SECTION. 77 WS-ERR-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS RECEIVE INTO (WS-INPUT) LENGTH(WS-LENGTH) RESP(WSERR-CODE) END-EXEC. IF WS-ERR-CODE = DFHRESP(LENGERR) IF WS-ERR-CODE = DFHRESP(NORMAL)
23 August 2013
CICS.ppt
86
While receiving the control, a sub-program can suspend Handle commands of the called program using PUSH HANDLE
While returning the control, it can restore the Handle command using POP HANDLE
23 August 2013
CICS.ppt
87
23 August 2013
CICS.ppt
88
23 August 2013
CICS.ppt
89
23 August 2013
CICS.ppt
90
END-EXEC
23 August 2013
CICS.ppt
91
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 92
File Handling
Supports VSAM Files to be defined to CICS as resources File opening, Closing done by CICS
23 August 2013
CICS.ppt
94
23 August 2013
CICS.ppt
95
23 August 2013
CICS.ppt
96
23 August 2013
CICS.ppt
97
KSDS
ESDS RRDS
23 August 2013
CICS.ppt
98
23 August 2013
CICS.ppt
99
Sequential
Start Browse Read Next
Read Previous
End Browsing Reset Browse
23 August 2013 CICS.ppt 100
RIDFLD(key-value)
[RBA|RRN] [UPDATE] END-EXEC
23 August 2013
CICS.ppt
101
[UPDATE]
END-EXEC
23 August 2013
CICS.ppt
102
23 August 2013
103
23 August 2013
CICS.ppt
104
23 August 2013
CICS.ppt
106
23 August 2013
CICS.ppt
107
FILE (file-name)
[RIDFLD(rec-key)]
23 August 2013
CICS.ppt
108
23 August 2013
CICS.ppt
109
Browse Commands
READNEXT
READPREV ENDBR
RESETBR
23 August 2013
CICS.ppt
110
[RRN | RBA]
[GTEQ | EQUAL] [GENERIC]
END-EXEC
23 August 2013
CICS.ppt
112
23 August 2013
CICS.ppt
113
23 August 2013
CICS.ppt
116
REWRITE Command
DELETE Command UNLOCK Command Browse Commands General Exceptions
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 117
23 August 2013
CICS.ppt
120
Not recoverable
23 August 2013
CICS.ppt
121
[TRIGLEV = number,]
[REUSE = YES|NO]
23 August 2013
CICS.ppt
122
23 August 2013
CICS.ppt
123
[OPEN = INITIAL|DEFERRED]
DFHDCT TYPE=SDSCI, DSCNAME = name, TYPEFIL = INPUT|OUTPUT|RDBACK
23 August 2013
CICS.ppt
124
Access
Across transactions Across terminals
Storage
Main - Non-recoverable
Auxiliary - Recoverable
TST entry required, VSAM file DFHTEMP
23 August 2013
CICS.ppt
127
23 August 2013
CICS.ppt
128
23 August 2013
CICS.ppt
129
23 August 2013
CICS.ppt
130
23 August 2013
CICS.ppt
131
NOTOPEN
23 August 2013
CICS.ppt
132
Queues Summary
Transient Data Queues Intrapartition Extrapartition
TDQ Commands
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 133
FORMAT TIME
DELAY POST WAIT START
23 August 2013
CICS.ppt
135
- Retrieves the data passed by START - Used to cancel the interval control requests e.g. DELAY, POST & START
SUSPEND ENQ
- Suspends task to execute high priority task - Gain exclusive control over a resource
DEQ
23 August 2013
CICS.ppt
136
23 August 2013
CICS.ppt
137
FORMATTIME ABSTIME(data-name)
[DATE (data-name) ] [FULLDATE (data-name) ] [MMDDYYYY (data-name) ]
[DDMMYYYY (data-name) ]
[YYYYMMDD (data-name) ] [YYYYDDMM (data-name) ] [YYYYDDD (data-name) ]
[DATESEP(data-name) | literal)]
[DATEFORM (data-name) ] [TIME (data-name) [TIMESEP [(data-name | literal) ] ] ] END-EXEC
23 August 2013 CICS.ppt 138
05 ABSOLUTE-TIME
PROCUDURE DIVISION. : EXEC CICS
ASKTIME ABSTIME(ABSOLUTE-TIME) END-EXEC. EXEC CICS FORMATTIME ABSTIME(ABSOLUTE-TIME) DDMMYYYY(WS-FULL-DATE) DATESEP END-EXEC.
23 August 2013 CICS.ppt 139
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 140
CICS programs can issue commands for SQL services in order to access the DB2 database. EXEC SQL function [options] END-EXEC
23 August 2013
CICS.ppt
142
CICS REGION
App. Pgm. EXEC SQL..
DB2
REGION
DB2 Database
23 August 2013 CICS.ppt 143
|
|
EXEC CICS...)
CICS DB2
DB2 Precompilation
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 145
Recovery/Restart facilities are required to minimize or if possible, eliminate the damage done to the online system, in case of the above failures to maintain the system & data integrity
CICS.ppt 147
23 August 2013
23 August 2013
CICS.ppt
148
[ROLLBACK]
END-EXEC
23 August 2013 CICS.ppt 150
When the failure occurs, changes made within the abending LUW will be backed out
23 August 2013 CICS.ppt 151
NOTE - Click on back arrow to return to the Agenda. 23 August 2013 CICS.ppt 152
EDS is a registered mark and the EDS logo is a trademark of Electronic Data Systems Corporation. EDS is an equal opportunity employer and values the diversity of its people. Copyright 2002, Electronic Data Systems. All rights reserved.