CICS
CICS
CICS
• Introduction to CICS
• Basic Mapping Support
• Program Control
• File Processing
• Error Handling
• Queues
• Interval and Task Control
• Recovery and Restart
• Program preparation
• CICS Supplied Transactions
• Case Study
1
Introduction to CICS
2
Batch & Online : Differences
Operating System
CICS
Enter Code :
User’s Files &
App. Database
4
DB/DC System
Terminals Data
Base
Central System
CICS System
Environment &
API routines,
and Application
Programs
5
CICS System Services
• Data-Communication Functions
• Data-Handling Functions
• System Services
• Monitoring Functions
6
Task & Transaction
7
Application Programming
Concepts
• Pseudo-Conversational
• Multitasking
• Multithreading
• Quasi-Reentrancy
8
Terminal Conversation
• Conversational : A mode of dialogue between program and
terminal based on a combination of sending message and
receiving message within the same task
– Since human response is slower than the CPU speed, a
significant amount of resource will be wasted just waiting
9
Terminal Conversation Example
PROCEDURE DIVISION.
:
FIRST-PROCESS.
EXEC CICS RECEIVE ---- <= TSK1,12345
END-EXEC.
: process
EXEC CICS SEND ----- <= EMP(12345) Details
END-EXEC.
* - - - - - - Program Waits For Response - - - - -
SECOND PROCESS.
EXEC CICS RECEIVE ----- <= User Enters Data
END-EXEC.
: process
10
Pseudo-Conversation Example
Transaction TSK1 Transaction TSK2
Program PROG2
Program PROG1
PROCEDURE DIVISION.
PROCEDURE DIVISION. :
: EXEC CICS
RECEIVE
EXEC CICS RECEIVE END-EXEC.
END-EXEC. :
: EXEC CICS SEND
EXEC CICS SEND END-EXEC.
EXEC CICS RETURN
END-EXEC. END-EXEC.
EXEC CICS RETURN
TRANSID (‘TSK2’)
END-EXEC.
11
CICS Components
• Control Programs (or Management Modules)
Programs that interface between OS and app. pgm
Handle the general functions that are crucial to operation of
CICS
• Control Tables
Define the CICS environment
Functionally associated with the management module
• Control Blocks (or Areas)
Contain system type information. Eg. Task Control Area
contains information about the task
12
Mangement Pgms & Ctrl Tables
• Programs • Tables
Program Control PCP
File control FCP Processing Program
Table PPT
Terminal Control TCP File Control Table FCT
Task Control KCP Terminal Control Table TCT
Temporary Storage TSP Program Control Table PCT
Temp. Storage Table TST
Transient Data TDP Destin. Control Table DCT
Storage Control SCP
Interval Control ICP
Journal Control JCP
13
CICS Program Considerations
Considerations:
14
CICS Program Restrictions
Restrictions:
• No CONFIG. SECTION, I/O SECTION to be specified in the
ENVIRONMENT DIVISION.
15
Sample CICS Program
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-INPUT.
05 WS-TRANSID PIC X(4).
05 FILLER PIC X(1).
05 WS-IN-EMP-CD PIC X(4) VALUE ALL
‘X’.
16
Sample Program (Contd..)
01 WS-OUTPUT.
05 FILLER PIC X(16) VALUE ‘EMP CODE : ‘.
05 WS-OUT-EMP-CD PIC X(4).
01 WS-LENGTH PIC S9(4) COMP.
LINKAGE SECTION.
CAN Include DFHCOMMAREA if data needs to be communicated
between two transactions or multiple iterations of the same
transaction.
PROCEDURE DIVISION.
000-MAINLINE.
PERFORM 100-RECV-INPUT.
PERFORM 200-SEND-OUTPUT.
EXEC CICS RETURN END-EXEC.
17
Sample Program (Contd..)
100-RECV-INPUT.
MOVE 9 TO WS-LENGTH.
EXEC CICS RECEIVE
INTO (WS-INPUT) LENGTH (WS-LENGTH)
END-EXEC.
MOVE WS-IN-EMP-CODE TO WS-OUT-EMP-CODE
200-SEND-OUTPUT.
EXEC CICS SEND
FROM (WS-OUTPUT) LENGTH (20)
ERASE
END-EXEC.
18
CICS Translator
19
Translator
20
Topics in BMS
• Introduction to BMS
• Map and Mapset
• Physical and Symbolic Map
• Map Definition Macros
• Screen Manipulation/Handling
• Screen Design Considerations
• Interfacing with Terminal using a Map
21
Introduction to BMS
Introductory concepts
In online systems, formatted screens are used. In order to display
formatted screen, a terminal (e.g. 3278) must receive a series of data
stream called Native Mode Data Stream (NMDS) based on the
hardware protocol; this NMDS is a mixture of Buffer Control
Characters (BCCs) and text data. NMDS is designed for a particular
terminal and is thus both device dependent and format dependent. So if
NMDS is used, re-coding is required whenever there is change in the
terminal device or screen format. To remove this device and format
dependency from application program, CICS provides a facility called
Basic Mapping Support (BMS).
22
Primary Functions of BMS
• Removal of device dependent codes from Application Program
• Removal of constant information from Application program
(Headers, Titles...)
• Construct NMDS - Native Mode Data Stream
• Text handling
• Terminal Paging & Message routing
• Contents of the screen defined thru’ BMS is called Map.
• Map is a program written in assembly language.
• BMS macros are available for Map coding.
The BMS Macros are coded in the form of Maps, and Mapsets to
define the screen attributes, screen field positions, and field
characteristics.
23
Map and Mapset
24
Map and Mapset (Contd..)
• Mapset name has two parts.
• Multimap Panel
25
Map and Mapset (Contd..)
The concepts of map and mapset can be utilized in two type of
cases as given below:
26
Types of MAPS
There are 2 types of MAPS
• Physical Map
Physical Map is a map used by CICS (CSECT)
Ensure device independence in the application program
BMS macro coding ==> Assembly==> Link edit ==> Load module ==>
LOADLIB ===> To be used by CICS
• Symbolic Map
Ensure device and format independence in the application program
Symbolic Map is a map used by Application Program (DSECT)
BMS macro coding ==> Assembly ==> Symbolic map definition ==>
COPYLIB ==> Copied (COPY) into CICS application program.
27
Example – Symbolic Map
01 EMPRECI.
02 FILLER PIC X(12).
02 EMPNAL PIC S9(4) COMP.
02 EMPNAF PIC X.
02 FILLER REDEFINES EMPNAF.
03 EMPNAA PIC X.
02 EMPNAI PIC X(21).
28
Physical & Symbolic Map - Logic Flow
BMS Assembler
source
Physical MAP
29
Physical Map
Physical Map.
• The BMS macros are assembled and link-edited into CICS load
library to create the physical map. The mapset like any other CICS
program is stored in CICS runtime library the PPT(Program
Processing Table). At the program execution time the physical
map is being used by CICS to load the screen image.
30
Symbolic Map
• The symbolic map is coded using the BMS macro, assembled
separately and catalogued into a copy library. The symbolic map
serves as a DSECT for referencing the Terminal Input/Output Area
(TIOA). The program issues a COBOL COPY statement to include it
in the program.
• The symbolic maps represents the actual data structure of the fields
defined in the physical map, and is used by the application program
to send and receive information from the terminal, in the CICS
SEND-MAP & RECEIVE MAP commands.
32
Map definition Macros (Contd..)
Explanations:
SETNAME : Name of the mapset. Used in CICS command to
read or write one of the maps in the mapset. It is
the load module name.
OPERATION : Macro identifier. Mapset/Map/Field definition.
OPERANDS : Optional key words (parameters) separated by
comma.
CONTD : Current line can be continued by leaving this
column non-blank (usually X) and the next line
have to be started in 16th column.
Comments : ‘*’ in column 1 makes the line comment.
33
Map definition Macros (Contd..)
INITIAL VALUES : Always surround initial values by
single quote marks
Escape Chars : ‘ and &
34
Order of Macros
35
DFHMSD Macro
The DFHMSD macro is used to define a mapset (TYPE=MAP)
and its characteristics or to end a mapset definition
(TYPE=FINAL). Only one mapset is allowed in one assembly
run. All the maps in a map set get assembled together, and
they're loaded together at execution time.
Example:
TSTMSET DFHMSD TYPE=&SYSPARM, X
MODE=INOUT, X
LANG=COBOL,
X
STORAGE=AUTO, X
TIOAPFX=YES,
X
CNTL=(FREEKB,FRSET,PRINT)
36
DFHMSD Macro (Contd..)
Options
37
DFHMSD Macro (Contd..)
STORAGE =
AUTO To acquire a separate symbolic map area for
each mapset
BASE To have the same storage base for the symbolic
maps of from more than one mapset
TIOAPFX=
YES To reserve the prefix space (12 bytes) for BMS
commands to access TIOA properly. Required for
the CICS command level.
38
DFHMSD Macro (Contd..)
CNTL= To define the device control requests
FREEKB To unlock the keyboard
FRSET To reset MDT to zero status
ALARM To set an alarm at screen display time
PRINT To indicate the mapset to be sent to the
printer
39
DFHMDI Macro
Defines a map and its characteristics
Example
EMPMAP DFHMDI SIZE=(ll,cc), X
LINE=nn, X
COLUMN=mm, X
JUSTIFY=LEFT/RIGHT
Options
SIZE=(ll,cc) To define the size of the map by the line size (ll)
and the column size (cc). Useful when the screen
contains.
LINE Indicates the starting line number of the map.
COLUMN Indicates the starting column number of the map.
JUSTIFY To specify the entire map (map fields) is to be left or
right justified.
40
DFHMDF Macro
The DFHMDF macro is used to define a field in a map and its
characteristics. This is the position on the screen where the field
should appear. It's the position relative to the beginning of the
map. Field starts with its attribute byte, so if POS=(1,1) is coded,
then the attribute byte for that field is on line 1 in column 1, and
the actual data starts in column 2. The length of the field (not
counting the attribute byte) is specified. Literals can be specified
within quotes; these character data is for an output field. It is
used to define labels and titles for the screen and keep them
independent of the program.
41
Sample Screen layout
The above defines the screen layout as given below:
Where
42
DFHMDF
Macro For The Above Layout
Define a field and its characteristics
Example
DFHMDF POS(ll,cc), X
INITIAL=‘Customer No. :’, X
ATTRB=ASKIP, X
LENGTH=14
CUSTNO DFHMDF POS=(ll,cc), X
ATTRB=(UNPROT,NUM,FSET,IC), X
JUSTIFY=RIGHT, X
PICIN=‘9(8)’, X
PICOUT=‘9(8)’, X
LENGTH=8
43
Attribute character
Function:
The attribute character is an invisible 1-byte character, which
precedes a screen field and determines the characteristics of a
field.
44
Attribute character (Contd..)
BRT Bright display of a field (highlight).
FSET Field set. MDT is set on so that the field data is to be sent
from the terminal to the host computer regardless of
whether the field is actually modified by the user.
45
Modified Data Tag
Function:
Modified Data Tag (MDT) is a one bit of the attribute character. If it
is off (0), it indicates that the terminal operator has not modified
the field. If it is on (1), it indicates that the operator has modified
this field. Only when MDT is on, the data of the field will be sent by
the terminal hardware to the host computer. An effective use of
MDT drastically reduces the amount of data traffic in the
communication line and thus improves performance.
46
Modified Data Tag (Contd..)
2. If CNTL=FRSET is specified in the DFHMSD or DFHMDI
macro, when the mapset or the map is sent to the terminal,
MDT will be reset to “0” (off) i.e. not modified for all the
fields of the mapset or the map.
47
Skipper Technique
48
Stopper Technique
49
Format Of the Symbolic Map
Format of Symbolic Map
• Once the symbolic map is assembled and is placed in the COPY
library, the COBOL COPY statement can be used to include it in the
application program.
• The symbolic map starts with the 01 level definition of the map
name specified in the DFHMDI macro with the suffix ‘I’ for the
input map and the suffix ‘O’ for the output map.
• Next is the definition of FILLER PIC X(12), which is the TIOA prefix
created by the TIOAPFX=YES of the DFHMSD macro; this is
required by the BMS under the CICS command level.
50
Format Of the Symbolic Map
(Contd..)
For each field name (1 to 7 characters) specified in the DFHMDF
macro, BMS creates three fields for inputs and three fields for
outputs, by placing one character suffix to the original field name.
The meaning of these fields are given below:
51
Format Of the Symbolic Map
(Contd..)
52
Example Of Symbolic Map
01 EMPRECI.
02 FILLER PIC X(12).
02 EMPNAL PIC S9(4) COMP.
02 EMPNAF PIC X.
02 FILLER REDEFINES EMPNAF.
03 EMPNAA PIC X.
02 EMPNAI PIC X(21).
53
Cursor Positioning Techniques
CICS provides multiple ways of to specify where to position the
cursor on the screen. The cursor positioning is important to prompt
an user of an entry he has to make, or to point to an error which
has occurred during editing the user entries.
Example :
DFHMDF
POS=(5,8),ATTRB=(UNPROT,FSET,IC),LENGTH=10
54
Cursor Positioning Techniques
(Contd..)
• Dynamic/Symbolic Positioning.
55
Cursor Positioning Techniques
(Contd..)
Example Of Dynamic Cursor Positioning.
WORKING-STORAGE SECTION.
:
COPY MAPSET1
01 MAPSET1I
05 FILLER PIC X(6).
05 FIELD1L PIC X(5).
05 FIELD1F PIC X.
05 FIELD1I PIC X.
56
Cursor Positioning Techniques
(Contd..)
PROCEDURE DIVISION.
: MOVE –1 TO FIELDL.
EXEC CICS SEND MAP(‘MAP1’)
MAPSET(‘MAPSET1’)
CURSOR
ERASE
END-EXEC.
The cursor will be placed at FIELD1 field of the map during
execution.
57
Cursor Positioning Techniques
(Contd..)
Dynamic/Relative Positioning (application program)
58
Cursor Positioning Techniques
(Contd..)
Example EXEC CICS SEND
MAP(‘MAP1’)
MAPSET(‘MAPSET1’)
CURSOR(100)
ERASE
END-EXEC.
59
Interfacing with a Terminal
using a Map
The BMS maps are used in the application programs for the actual
terminal input/output operation. These operations are performed
by a set of CICS commands for BMS.
The following are the three basic functions performed by CICS
commands:
1. Map Sending function – using the data in the symbolic map,
BMS prepares the output NMDS, the corresponding physical
map, and sends to the terminal.
2. Map Receiving Function – using the input NDMS from the
terminal, BMS prepares data in the symbolic map through the
corresponding physical map.
3. Text Handling Function – BMS prepares text without using a
map and sends to the terminal.
60
Interfacing with a Terminal
using a Map (Contd..)
Flow of Information from 3270 Terminal and the Application Program.
Application
Program Symbolic BMS Output Terminal
Send Map Map NDMS
Command
Physical Data
Map Entry
Application
Program Symbolic BMS Input Terminal
Receive Map NDMS
Command Map
61
Interfacing with a Terminal
using a Map (Contd..)
The following are the available commands:
62
Receive Map Command
RECEIVE MAP Command is used to receive input from a terminal.
At the completion of the command, the symbolic map will contain
valid data from the terminal in the following three fields as per each
field defined by the DFHMDF macro:
63
Receive Map Command
(Contd..)
64
Receive Map Command
(Contd..)
MAP specified the name of the MAP defined thru DFHMDI
command , which describes the screen details.
66
SEND MAP Command
The SEND MAP command is used to send formatted output to a terminal.
Before issuing this command, the application program must prepare the
data in the symbolic map of the map to be sent, which has the following
three fields per each field defined by the DFHMDF macro:
Name + L: The length field, for which the application program need not
prepare except when used for the dynamic cursor positioning.
Name + A: The Attribute byte for output fields. Application program will
use it for dynamic cursor positioning.
Name + O: The actual output data field, where the application program
places the data.
67
SEND MAP Command (Contd..)
EXEC CICS SEND MAP(MAP1)
MAPSET(MAPSET1) ]
[FROM(DATANAME) ], [DATAONLY] | MAPONLY],
[ CURSOR(VALUE) ],
[ FREEKB ] , [ ERASE ] , [ FRSET ] ,
[ HANDLE | NOHANDLE ] ,
[ RESP (DATANAME) ]
END-EXEC.
• Conditions : INVREQ,LENGERR
68
SEND MAP Command (Contd..)
MAP specified the name of the MAP defined thru DFHMDI command
, which describes the screen details.
69
SEND MAP Command (Contd..)
FROM is used to specify the area in the working storage section
from which the data is to be sent to the terminal.
70
AID KEYS
First time when a transaction is initiated the application program
throws the screen image on the terminal thru SEND MAP command.
Once the screen appears, the AID (Attention Identifier ) Keys are
being used to send the information back from the terminal to CICS to
application program. CICS application program needs to trap the
attention identifier keys and process various functions related to the
AID keys.
Salient Points
• PF keys, PA keys, ENTER & CLEAR key
71
AID KEYS (Contd..)
• DFHAID – CICS System copybook which stores the values of
the EIBAID field for the various AID keys. Flow : User hits
AID key – Control goes to CICS – To Application program.
EIBAID contains information about the last AID key pressed.
Program compares EIBAID to the DFHAID field and
performs processing logic as per the AID key pressed.
Conditions : INVREQ
72
Screen Design Considerations
73
Screen Design Considerations
(Contd..)
• Large fields can be broken into a number of small fields. E.g.
the field contact information can be split into contact
numbers, email ids and postal address.
74
Screen Design Considerations
User-Friendly Screen Design
• Screens should be simple and friendly.
• Default values in fields helps in reducing keystrokes by the
users. Also, in case the user forgets to enter a field data,
defaults values are assigned according to the field.
• Calculations should be done by program and not by users.
• The cursors should be placed in the appropriate fields.
• Highlight the error field. Using a different colour or blinking
the error field can achieve this. This enables users to identify
the erroneous field easily.
75
Screen Design Considerations
(Contd..)
• Alarm sound can be used for error entries.
• Provide suitable help messages for erroneous entries. The
help message should be instructive and kind and should not
be rude.
• Provide help on fields and their meanings. Using an attention
key for a help menu, which has details on each field, makes a
screen user-friendly.
76
Screen Design Considerations
(Contd..)
• Colour can help in improving the screen design; however the
colour used should be in accordance with the norms and
standards followed.
77
Exercise - 1
78
CICS VS FILE PROCESSING
File handling in CICS is achieved thru a set of file handling
commands. It is essential to know the various file handling
commands for application programming.
79
CICS VS FILE PROCESSING
Instead, CICS has a list of all the files it is allowed
To access.
Files do not need to exclusively
defined in Application This list is called the FILE CONTROL TABLE
programs. The files do not need (FCT) and is maintained by the systems
programmers
to opened and closed in a CICS
application program , before When CICS/VS is started up. It goes through the
being used in the program. FCT and makes all the files available. When
CICS/VS is closed down it closes all the files.
80
CICS COBOL V/S COBOL
BATCH COBOL CICS
COBOL
81
VSAM
82
Services Provided By CICS
• Basic Operations required for a file are
Adding a Record.
Modifying an Existing Record.
Deleting an Existing Record.
Browsing One or Selected or All Records.
83
Defining A File in CICS
• Files should be defined in FCT (File Control Table).
• FCT will contain all the Information about a file (like dataset
name, access methods, permissible file service request, etc.)
85
Syntax of DFHFCT Macro
DFHFCT TYPE=FILE,ACCMETH=VSAM,
DATASETNAME=NAME,
SERVRQ=(ADD,BROWSE,DELETE,READ,UPDATE),
FILSTAT=(ENABLED,OPENED)
86
File Handling in Programs
87
Important Key-Words
• Dataset/File :- Name in the FCT.
88
Random READ
EXEC CICS READ File(filename)
[SET() | Into()]
RIdfld(Rec-Key)
END-EXEC.
89
Example for Random Read
90
Sequential Read
91
Syntax for STARTBR
92
Reading the Record after
STARTBR
93
Syntax of READNext/READPrev
EXEC CICS READNext | READPrev
FILE(name)
INTO(data-area)|SET(ptr-ref)
RIDFLD(data-area)
END-EXEC.
94
ENDBRowse
• ENDBRowse terminates a Previously issued STARTBR.
• SYNTAX :
EXEC CICS ENDBR
FILE(filename)
END-EXEC.
Condition: INVREQ
95
RESETBR
• Its effect is the same as ENDBR and then giving another
STARTBR.
• Syntax :
EXEC CICS RESETBR
FILE(filename)
RIDFLD(data-area)
END-EXEC.
96
WRITE Command
• Adds a new record into the File.
• For ESDS, RIDFLD is not used but after write execution, RBA
value is returned and Record will be written at the end of the
File.
• For KSDS, RIDFLD should be the Record Key. The record will
be written depending on the Key.
• MASSINSERTion must be done in ascending order of the Key.
97
Syntax for WRITE
EXEC CICS WRITE
FILE(filename)
FROM(data-area)
RIDFLD(data-area)
END-EXEC.
98
REWRITE Command
99
Syntax for REWRITE
100
DELETE Command
101
Syntax of DELETE
EXEC CICS DELETE
FILE(filename)
RIDFLD(data-area) Optional
END-EXEC.
102
UNLOCK
• To Release the Record which has been locked by READ with
UPDATE Command.
• Syntax :
EXEC CICS UNLOCK
FILE(filename)
:
[other options]
END-EXEC.
103
General Exceptions
• The following exceptions usually will occur for ALL CICS file
handling commands.
FILENOTFOUND,
NOTAUTH,
SYSIDERR,
INVREQ
104
Error Handling in CICS
Possible Errors:
• Conditions that aren't normal from CICS's point of view but
that are expected in the program.
• Conditions caused by user errors and input data errors.
• Conditions caused by omissions or errors in the application
code.
• Errors caused by mismatches between applications and
CICS tables, generation parameters and JCL
• Errors related to hardware or other system conditions beyond
the control of an application program.
105
Error Handling methods
106
Error Handling methods
(Contd..)
• HANDLE CONDITION condition[(label)]... 'condition' specifies
the name of the condition, and 'label' specifies the location
within the program to be branched
• Remains active while the program is executing or until it
encounters IGNORE/another HANDLE condition.
• Syntax :
EXEC CICS HANDLE CONDITION
ERROR(ERRHANDL)
LENGERR(LENGRTN)
END-EXEC
This example handles DUPREC condition separately, all the
other Errors together. LENGERR will be handled by system
107
HANDLE Condition
Example of Handle condition:
This condition catches the NOTFND condition and transfers control to the
REC-NOT- FOUND paragraph in the program. The error handling logic can be
coded in the REC-NOT-FND paragraph.
108
Alternative to Handle condition
109
IGNORE Condition
110
Sample program to use Handle
condition
Here is an example of the CICS- COBOL code with proper
handling of errors
Procedure Division.
EXEC CICS HANDLE CONDITION
NOT-FND(REC-NOT-FOUND)
END EXEC.
:
EXEC CICS READ
DATASET(SAMPLE)
RIDFLD(EMP-NO)
INTO (EMP-REC)
END-EXEC
:
GO TO LAST-PART
111
Sample program to use Handle
condition (Contd..)
REC-NOT-FOUND
MOVE ‘NOT-ON-FILE’ TO NAMEO ( SYMBOLIC MAP
PARAMETER)
LAST-PART.
EXEC CICS SEND
MAP (‘TC0BM31’)
MAPSET(‘TC0BM30’)
FROM (‘TC0BM310’)
DATA-ONLY
END-EXEC
112
PUSH & POP
113
Syntax of Push & Pop
• Syntax of Push :
• Syntax of Pop :
114
EXEC Interface Block (EIB)
• CICS provides some system-related information to each task as
EXEC Interface Block (EIB)
• Unique to the CICS command level
EIBAID Attention- Id (1 Byte)
EIBCALEN Length of DFHCOMMAREA (S9(4) comp)
EIBDATE Date when this task started (S9(7) comp-3)
EIBFN Function Code of the last command ( 2
Bytes)
EIBRCODE Response Code of the last command (6
Bytes)
EIBTASKN Task number of this task (S9(7) comp-3)
EIBTIME Time when this task started (S9(7) comp-3)
EIBTRMID Terminal-Id (1 to 4 chars)
EIBTRNID Transaction-Id (1 to 4 chars)
115
Processing Program Table - PPT
DFHPPT TYPE=ENTRY
PROGRAM |MAPSET= name
[PGMLANG= ASM|COBOL|PLI]
[RES= NO|FIX|YES]
:
: other options
:
Eg.
DFHPPT TYPE=ENTRY,PROGRAM=TEST,
PGMLANG=COBOL
116
PCT Entry
DFHPCT TYPE=ENTRY
TRANSID= name
PROGRAM=name
TASKREQ=pf6
RESTART=yes/no ( TRANSEC = 1 to 64)
RSLKEY= 1 to 24 resource level key
SCTYKEY= 1 to 64 security key
:
:
other options
117
Program Control Commands
• LINK
• XCTL
• RETURN
• LOAD
• RELEASE
118
LINK
119
LINK Syntax
120
XCTL
121
XCTL Syntax
122
RETURN
123
RETURN Syntax
124
CICS Level 0
PROG A Level 1
LINK
RETURN
PROG C Level 2
PROG B
XCTL LINK
RETURN
Level 3
Application Program
PROG D PROG E
Logic Levels
XCTL RETURN
125
LOAD
• To load program/table/map from the CICS DFHRPL concatenation
library into the main storage
• Using load reduces system overhead
• Syntax :
126
RELEASE
127
COMMAREA
128
CICS - DB2
129
Operating system
DB2
Database
131
DB2 - Precompiler
Source Program (EXEC SQL...
| EXEC CICS...)
DB2 Precompiler
|
CICS command translator
|
Compile By COBOL
|
Linkedit by Linkage editor
|
Load Module
132
Transient data Control
133
TDQs
134
TDQs
• Operations
135
WRITEQ TD
• Syntax :
EXEC CICS WRITEQ TD
QUEUE(name)
FROM(data-area)
[LENGTH(data-value)]
[SYSID(systemname)]
END-EXEC.
136
READQ TD
137
DELETEQ TD
138
Destination Control Table
139
Automatic Task Initiation
140
Temporary Storage Control
141
TSQs
• Operations
– Write and Update data
– Read data - Sequential and random
– Delete the queue
• Access
– Across transactions
– Across terminals
• Storage
– Main - Non-recoverable
– Auxiliary - Recoverable
– TST entry required, VSAM file DFHTEMP
142
TSQs - Typical uses
• Terminal Paging
• Report printing
143
WRITEQ TS
• Syntax :
EXEC CICS WRITEQ TS
QUEUE(name)
FROM(data-area)
[LENGTH(data-value)]
[NUMITEMS(data-area) |
ITEM(data-area) [REWRITE] ]
[MAIN|AUXILIARY]
[NOSUSPEND]
END-EXEC.
• Syntax :
EXEC CICS READQ TS
QUEUE(name)
{INTO(data-area) | SET(ptr-ref) }
LENGTH(data-value)
[NUMITEMS(data-area)]
[ITEM(data-area) | NEXT ]
END-EXEC.
145
DELETEQ TS
146
ASKTIME
147
FORMATTIME
• Syntax :
EXEC CICS FORMATTIME ABSTIME(data-ref)
[YYDDD(data-area)]
[YYMMDD(data-area)]... etc.
[DATE(data-area) [DATEFORM[(data-area)]]]
[DATESEP[(data-value)]]
[DAYOFMONTH(data-area)]
[MONTHOFYEAR(data-area)]
[YEAR(data-area)].....
[TIME(data-area) [TIMESEP[(data-value)]]]
END-EXEC.
149
START
• Used to start a transaction at the specified terminal and at the
specified time or interval
• Data can be passed to the new transaction
• Syntax :
EXEC CICS START
TRANSID(transid)
[TERMID(termid)
TIME(hhmmss) | INTERVAL(hhmmss) ]
END-EXEC
150
Other Interval Control
Commands
• POST - to request notification when the specified time has
expired.
• WAIT EVENT - to wait for an event to occur.
• RETRIEVE - Used to retrieve the data passed by the START
• CANCEL -Used to cancel the Interval Control requests. eg.
DELAY,POST and START identified by REQID.
• SUSPEND - Used to suspend a task
• ENQ - to gain exclusive control over a resource
• DNQ - to free the exclusive control from the resource gained by
ENQ
151
The Need for Recovery/Restart
• The possible failures that can occur outside the CICS system are
Communication failures (in online systems)
Data set or database failures
Application or system program failures
Processor failures & Power supply failures.
152
RECOVERY
• Recoverable Resources
VSAM files
Intrapartition TDQ
TSQ in the auxiliary storage
DATA tables
Resource definitions & System definition files
153
RESTART
154
Facilities for Recovery/Restart
155
Dynamic Transaction Backout
(DTB)
• When the transaction fails, backing out the changes made by
the transaction while the rest of the CICS system continues
normally is called DTB
156
LUW & SYNC point
157
LUWs & SYNC pts
|- - - - - - - - - - - - LUW - - - - - - - - - |
Task A|---------------------------------------------|
SOT EOT-SP
158
Automatic Transaction Restart
159
Introduction
160
Program preparation
IF DB2 :
SOURCE
DB2
PRECOMPILER
CICS
COMPILER
COBOL
COMPILER
LOAD LINK
MODULE EDIT
161
Preparing a Program
162
Translation
163
Compiling or Linking
164
Defining the Program
165
CESN/CESF Transactions
166
CECI - Command Level
Interpreter
• To build and test the effect of EXEC CICS commands
• CECI ASSIGN is used to get the current userid,sysid, terminal id,
application id etc..
• Before using the maps in programs, it can be tested using CECI
to check how it appears on the screen.
• CECI gives the complete command syntax of the specified
command.
• CECI READQ TD QUEUE(TESTL001) will read the current
record of the given TDQ
167
CEMT-Master Terminal
Transaction
168
CEDF-Execution Diagnostic
Facility
• To test command level application programs interactively
• CEDF [termid/sysid/sessionid] [,ON/,OFF]
• Termid - the identifier of the terminal on which the transaction to
be tested is being run
• Sessionid - To test/monitor a transaction attached across an
MRO/ISC session
• Sysid - To test a transaction across an APPC session
169
CEDF (Contd..)
170
CEBR-Temporary Storage
Browse
• To browse the contents of CICS temporary storage queues
(TSQ)
• CEBR by default will show the queue associated with the current
terminal ‘CEBRL001’ which can be overridden to view any other
queue
• TERM to browse TSQ for another terminal
• QUEUE to make the named queue, current
• PUT to copy the current queue contents into TDQ
• GET to fetch TDQ for browsing
• PURGE erases the contents of the current queue
171
Exercise - 2
172