Identification Division.
No differences MUST be EMPTY in CICS Program! No SELECT statements allowed! No FILE SECTION (No SELECTS)
1
WORKING-STORAGE SECTION.
Switches, Flags, Variables, Records, etc. You get fresh copy each time program loaded!
Environment Division
Data Division
CICS-Prg
CICS-Prg
EIBCALEN (First time pro ram loaded) COMMAREA (Tran-ID, EIBAID) Hidden Data on Screen
CICS-Prg
CICS- r
Can be nested (or not if careful!) Usually each path ends with RETURN EVALUATE TRUE most common (New Dev) General WHEN OTHER for errors
CICS- r
Switches, Fla s, and Misc Variables COMMUNICATION-AREA (Your copy!) RESPONSE-CODE PIC S9(08) COMP. RECORD Descriptions COPY Library for MAP Other COPY Members as needed
CICS- r
DFHCOMMAREA
PIC X(nnn).
If you don t code it, CICS Will! The commarea (if any) placed here! EIBCALEN gives length of commarea 0 (ZERO) means there is NO commarea
CICS-Prg
PROCEDURE DIVISION
EVALUATE TRUE WHEN EIBCALEN = 0 First time in Program WHEN EIBAID = DFHENTER Process Screen WHEN EIBAID = DFHPF3 or DFHPF12 Exit Program WHEN OTHER Invalid key END-EVALUATE
CICS-Pr
CICS-Pr
10
END-EXEC
CICS-Pr
11
CICS-Pr
12
END-EXEC
13
CICS-Pr
14
END-EXEC
CICS-Pr
15
CICS-Pr
16
Any action that starts pro ram List All (Valid) Possible User Actions
CICS-Pr
CICS-Pr
18
Helps with design or Program Serves as Documentation of Program Sometimes replaced with Structure Chart Start with Major Functions Add Detail as Needed Assign Paragraph Numbering (If Used)
CICS-Prg 9
END-EXEC
CICS-Prg
20
CICS-Prg
22
Exception Conditions
Most Common Exceptions:
Dataset disabled Record already exists Dataset not in FCT Invalid request File I/O error User not authorized Record not in file
CICS-Prg 24
Add busy fla in record (Special Maint) All pro rams MUST follow procedure Extra I/O required (to Set/Reset fla )
DETECT
Save copy and compare before updatin OR Add Maint-Timestamp and check it Notify User to et latest version of data
Avoidin Deadlock
Sometimes called Deadly Embrace Happens when records from multiple files must be updated as a unit
CICS-Prg
Withdraw from Savin s Deposit to Check Crash after withdraw? Where s money?
CICS-Pr
27
CICS-Pr
28
END-EXEC NOTE: Pro ram name must be in PPT. Works like COBOL PERFORM statement.
!
CICS-Pr
29
CICS-Pr
30
Terminal Handling
CURSOR Positioning (in SEND MAP)
CURSOR(nnn) where nnn is position on screen Displacement from start of the screen ( Row 1 ) * 80 + ( Column 1 ) 0 is Row 1, Column 1 1919 is Row 24, Column 80 (24 by 80 Screen) Changes in screen require changes to program
Specify the FIELD where the CURSOR goes Place 1 in the LENGTH Attribute of the field
"
Attribute Modification
Symbolic Map includes Attribute byte Field Name with A appended Cryptic bit codes and names used Copy library supplied by IBM (Horrible) Most shops have their own copy book We don t have extended attributes !
EIBCPOSN in EIB Block (binary halfword) READ only-Available before RECEIVE MAP Can be used to determine user selection instead of requirin user to enter character
'
CICS-Pr
$
33
CICS-Pr
$
34
CICS-Pr
$
36
Pro ram Attention Keys Pro ram Function Keys The ENTER Key The CLEAR Key Any key not Specified (Except the ENTER key)
0 0
CICS-Pr
(
37
CICS-Pr
(
Error Processin
There are over 70 CICS error Conditions Mercifully only a few are handled TWO Methods of handlin exceptions:
2
END-EXEC NOTE: HANDLE AID sets up RECEIVE MAP! Not executed when encountered! In OLD Pro s.
0
CICS-Pr
(
39
CICS-Pr
(
40
CICS-Pr
(
41
CICS-Pr
(
42
HANDLE CONDITION
Common CONDITIONS
Record already exists No data sent by user No space left in file Data set not OPEN Record not in file Program not in PPT ALL conditions not coded
CICS-Prg
Not many CICS Commands use it Seldom needed as RESP is usually enou h
9
CICS-Prg
CICS-Pr
8
46
LINKAGE SECTION
Used to access data left by previous execution of a pro ram Data should be moved to your W/S! Each execution starts with initial W/S Define COMMAREA in Workin -Stora e DEFINE DFHCOMMAREA in Linka e RETURN references Workin -Stora e
B B B B B B
CICS-Pr
@
47
CICS-Pr
@
48
iler E
V
) I
V v P
S E E I I CE
` a a
engt of C E Current I Ke resse Position of CU S ask E( ) ask i e ( SS) ransaction of ask er inal I of ask ecentl use esource a e ecentl accesse ata Set
Y b d d X e X X a e b e a X c a a a c d d c a c e e ` e a
G H T
c ` d
c c c c
i p
CICS-Prg
9
C
CICS-Prg
EBUGGI G EIB IE
y
S
t W
Infrequentl
ESP ESP2 C E S CE
P S V X c Y
ast CICS Co an Co letion Status ore Co letion Status es onse Co e ( ) ecent esource a e
I t t f T t f V W I P S f V V v t
CW
U
Co
on Work rea
U
P P GC I EC
Y
-EXEC
Q V V V V c Y
CS W C U
U u T
Co on S ste rea ransaction Work rea er inal Control a le User rea ust esta lis ressa ilit if nee e
u U U u t u g U s U W W W g g h
u u
CICS-Prg
CICS-Prg
ee e Stuff
Infrequentl
ee e Stuff
ESS
CW )
U
V S
CICS-Prg
CICS-Prg