Beruflich Dokumente
Kultur Dokumente
1
Table of Contents
• 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
2
Introduction to CICS
3
Batch & Online : Differences
Operating System
CICS
Enter Code :
User’s Files &
App. Database
5
DB/DC System
Terminals Data
Base
Central System
CICS System
Environment &
API routines,
and Application
Programs
6
CICS System Services
• Data-Communication Functions
• Data-Handling Functions
• System Services
• Monitoring Functions
7
Task & Transaction
8
Application Programming
Concepts
• Pseudo-Conversational
• Multitasking
• Multithreading
• Quasi-Reentrancy
9
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
10
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
11
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.
END-EXEC. EXEC CICS RETURN
EXEC CICS RETURN END-EXEC.
TRANSID (‘TSK2’)
END-EXEC.
12
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
13
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
14
CICS Program Considerations
Considerations:
15
CICS Program Restrictions
Restrictions:
• No CONFIG. SECTION, I/O SECTION to be specified in the
ENVIRONMENT DIVISION.
16
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’.
17
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.
18
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.
19
CICS Translator
20
Translator
21
Basic Mapping Support
22
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
23
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).
24
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.
25
Map and Mapset
26
Map and Mapset (Contd..)
• Mapset name has two parts.
27
Map and Mapset (Contd..)
The concepts of map and mapset can be utilized in two
type of cases as given below:
28
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.
29
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).
30
Physical & Symbolic Map - Logic Flow
BMS Assembler
source
Physical MAP
31
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.
32
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.
34
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.
35
Map definition Macros (Contd..)
INITIAL VALUES : Always surround initial values
by single quote marks
Escape Chars : ‘ and &
36
Order of Macros
37
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)
38
DFHMSD Macro (Contd..)
Options
TYPE= To define the map type
DSECT For symbolic map
MAP For physical map
&SYSPARM For special assembly procedure
FINAL To indicate the end of a mapset
coding
MODE= To indicate input/output operations
IN For an input map only
OUT For an output map only
INOUT For maps involving both input and
output.
39
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.
40
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
41
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.
42
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.
43
Sample Screen layout
The above defines the screen layout as given below:
Where
44
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 45
Attribute character
Function:
The attribute character is an invisible 1-byte character, which
precedes a screen field and determines the characteristics of a
field.
46
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.
47
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.
49
Skipper Technique
• DFHMDF POS(ll,cc),ATTRB=ASKIP,LENGTH=1
• To skip the cursor to the next unprotected field after one
unprotected field.
• Screen Layout :
&xxxxx&$ &xx
where
$ Skipper field
& Attribute byte
X Unprotected field
50
Stopper Technique
• DFHMDF POS(ll,cc),ATTRB=PROT,LENGTH=1
• To stop the cursor in order to prevent erroneous field overflow by
terminal user.
• Screen Layout :
&xxxxx&$#&$
where
# Stopper field
51
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.
53
Format Of the Symbolic Map
(Contd..)
• Name + F: Flag Byte. For the input field, it will be
X’80’ if the field has been modified but no data is
sent (i.e. the field has been cleared). Otherwise this
field is X’00’.
54
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).
55
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
56
Cursor Positioning Techniques
(Contd..)
• Dynamic/Symbolic Positioning.
57
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.
58
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.
59
Cursor Positioning Techniques
(Contd..)
Dynamic/Relative Positioning (application program)
60
Cursor Positioning Techniques
(Contd..)
Example EXEC CICS SEND
MAP(‘MAP1’)
MAPSET(‘MAPSET1’)
CURSOR(100)
ERASE
END-EXEC.
61
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:
• Map Sending function – using the data in the symbolic map,
BMS prepares the output NMDS, the corresponding physical
map, and sends to the terminal.
• Map Receiving Function – using the input NDMS from the
terminal, BMS prepares data in the symbolic map through the
corresponding physical map.
• Text Handling Function – BMS prepares text without using a
map and sends to the terminal.
62
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 Input
Program Symbolic BMS Terminal
Receive Map Map NDMS
Command
63
Interfacing with a Terminal
using a Map (Contd..)
The following are the available commands:
64
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:
65
Receive Map Command
(Contd..)
66
Receive Map Command
(Contd..)
MAP specified the name of the MAP defined thru DFHMDI
command , which describes the screen details.
68
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:
• Conditions : INVREQ,LENGERR
70
SEND MAP Command (Contd..)
MAP specified the name of the MAP defined thru DFHMDI command
, which describes the screen details.
71
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.
72
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
73
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
74
Screen Design Considerations
75
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.
76
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.
77
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.
78
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.
79
Exercise - 1
Exercise - 1
80
CICS File Processing
Techniques
81
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.
82
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.
83
CICS COBOL V/S COBOL
BATCH COBOL CICS
COBOL
84
VSAM
85
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.
86
Defining Files
87
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.)
88
Syntax of DFHFCT Macro
DFHFCT TYPE=FILE,ACCMETH=VSAM,
DATASETNAME=NAME,
SERVRQ=(ADD,BROWSE,DELETE,READ,UPDATE),
FILSTAT=(ENABLED,OPENED)
89
File Handling in Programs
90
Important Key-Words
• Dataset/File :- Name in the FCT.
91
Random READ
EXEC CICS READ File(filename)
[SET() | Into()]
RIdfld(Rec-Key)
END-EXEC.
92
Example for Random Read
93
Sequential Read
• Sequential Read is done by Browse Oper.
• Establish the pointer to the First Record to be Read Using
StartBr.
• Next and Previous Records can be Read as required Using
ReadNext and ReadPrev.
• End the Browse Operation at last.
• Browse can be re-positioned.
• During Browse Operation, Records cannot be Updated.
94
Syntax for STARTBR
95
Reading the Record after
STARTBR
96
Syntax of READNext/READPrev
EXEC CICS READNext | READPrev
FILE(name)
INTO(data-area)|SET(ptr-ref)
RIDFLD(data-area)
END-EXEC.
97
ENDBRowse
• ENDBRowse terminates a Previously issued STARTBR.
• SYNTAX :
EXEC CICS ENDBR
FILE(filename)
END-EXEC.
Condition: INVREQ
98
RESETBR
• Its effect is the same as ENDBR and then giving another
STARTBR.
• Syntax :
EXEC CICS RESETBR
FILE(filename)
RIDFLD(data-area)
END-EXEC.
99
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.
100
Syntax for WRITE
EXEC CICS WRITE
FILE(filename)
FROM(data-area)
RIDFLD(data-area)
END-EXEC.
101
REWRITE Command
102
Syntax for REWRITE
103
DELETE Command
104
Syntax of DELETE
EXEC CICS DELETE
FILE(filename)
RIDFLD(data-area) Optional
END-EXEC.
105
UNLOCK
• To Release the Record which has been locked by READ with
UPDATE Command.
• Syntax :
EXEC CICS UNLOCK
FILE(filename)
:
[other options]
END-EXEC.
106
General Exceptions
• The following exceptions usually will occur for ALL CICS file
handling commands.
FILENOTFOUND,
NOTAUTH,
SYSIDERR,
INVREQ
107
CICS Error Handling
Procedures
108
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.
109
Error Handling methods
110
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
111
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.
112
Alternative to Handle condition
113
IGNORE Condition
114
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 115
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
116
PUSH & POP
117
Syntax of Push & Pop
• Syntax of Push :
• Syntax of Pop :
118
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)
119
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
120
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
121
PROGRAM CONTROL
122
Program Control Commands
• LINK
• XCTL
• RETURN
• LOAD
• RELEASE
123
LINK
124
LINK Syntax
125
XCTL
126
XCTL Syntax
127
RETURN
128
RETURN Syntax
129
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
130
LOAD
• To load program/table/map from the CICS DFHRPL concatenation
library into the main storage
• Using load reduces system overhead
• Syntax :
131
RELEASE
132
COMMAREA
133
Communication With
Databases
134
CICS - DB2
135
Operating system
DB2
Database
137
DB2 - Precompiler
Source Program (EXEC SQL...
| EXEC CICS...)
DB2 Precompiler
|
CICS command translator
|
Compile By COBOL
|
Linkedit by Linkage editor
|
Load Module
138
QUEUES
139
Transient data Control
140
TDQs
• Operations
142
WRITEQ TD
• Syntax :
EXEC CICS WRITEQ TD
QUEUE(name)
FROM(data-area)
[LENGTH(data-value)]
[SYSID(systemname)]
END-EXEC.
143
READQ TD
144
DELETEQ TD
145
Destination Control Table
146
Automatic Task Initiation
147
Temporary Storage Control
148
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
149
TSQs - Typical uses
• Terminal Paging
• Report printing
150
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.
152
DELETEQ TS
153
INTERVAL & TASK
CONTROL
154
ASKTIME
155
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.
157
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
158
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
159
Recovery & Restart
160
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.
161
RECOVERY
• Recoverable Resources
VSAM files
Intrapartition TDQ
TSQ in the auxiliary storage
DATA tables
Resource definitions & System definition files
162
RESTART
163
Facilities for Recovery/Restart
164
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
165
LUW & SYNC point
166
LUWs & SYNC pts
|- - - - - - - - - - - - LUW - - - - - - - - - |
Task A|---------------------------------------------|
SOT EOT-SP
167
Automatic Transaction Restart
168
Program Preparation
169
Introduction
170
Program preparation
IF DB2 :
SOURCE
DB2
PRECOMPILER
CICS
COMPILER
COBOL
COMPILER
LOAD LINK
MODULE EDIT
171
Preparing a Program
172
Translation
173
Compiling or Linking
174
Defining the Program
175
CICS Supplied Transactions
176
CESN/CESF Transactions
177
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
178
CEMT-Master Terminal
Transaction
179
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
180
CEDF (Contd..)
181
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
182
Exercise - 2
Exercise - 2
183
Thank You
184