cics overview
DESCRIPTION
CICS Overview. Introduction. Customer Information Control System (CICS) Runs on VSE/ESA, MVS/XA, MVS/ESA, MS/DOS or OS/2 Can be used with VSAM, IMS-DL/I, SQL/DS and DB2. Topics of Discussion. Fundamentals Basic Mapping Support Maps & Display Addressability Techniques - PowerPoint PPT PresentationTRANSCRIPT
CICS Overview
04/19/23 2
Introduction
Customer Information Control System (CICS)
Runs on VSE/ESA, MVS/XA, MVS/ESA, MS/DOS or OS/2
Can be used with VSAM, IMS-DL/I, SQL/DS and DB2.
04/19/23 3
Topics of Discussion Fundamentals Basic Mapping Support Maps & Display Addressability Techniques Error Handling in CICS CICS Queuing Facilities IBM supplied CICS transactions Command Summary
04/19/23 4
Fundamentals Online vs. Batch Programs CICS Management Functions Multitasking & Multithreading Conversational & Psuedo
Conversational Programming Quasi reentrancy Task & Transaction Execution Interface Block COMMAREA Link & XCTL
04/19/23 5
CICS Management Functions
Terminal Management Security Management Task Management Program Management File Management Queue Management Recovery Management System Services
04/19/23 6
Terminal Control
End-User enters the transaction-id and presses the enter key.
VTAM receives the message and passes it to CICS.
Terminal Control accepts this input message and passes it to CICS.
TCT is referred to determine the terminal status.
04/19/23 7
Task Control
A task is created to execute the transaction
All transactions are defined in PCT Task Control validates transactions
by checking the PCT, and passes the control to the correct application program.
Invalid Trans-id, error message shown.
04/19/23 8
Program Control Program Control receives from the
Task Control. All Application Programs are
defined in the PPT. When Application Program is first
loaded, its address is also stored in PPT.
Only one copy of the program is loaded into the memory and many end-users can access it simultaneously
04/19/23 9
User Application Programs PCP passes control to the
Application Program Application program now process
the input and issues commands to request services needed.
04/19/23 10
BMS - Input
BMS simplifies programming for 3270 devices by providing Format & Device Independence.
Device Independence – Enabling AP to communicate with Terminal without knowing internal hardware control characteristics
Format Independence – Simplifies positioning of data on the terminal.
04/19/23 11
File Control & Database Access Application program issues
command to retrieve data from a VSAM file/DB2 Table
All VSAM files are defined in FCT. CICS supports DB2 via SQL
commands.
04/19/23 12
Journal Control If a record in a file or database is
changed, the change is registered in system log through Journal Control Facility to permit recovery in case of a failure.
When appropriately defined, journal processing is performed automatically.
The System Log is defined in JCT
04/19/23 13
Temporary Storage Control Application program may need to
store info for later retrieval. Temporary Storage Facility will
facilitate such storage. An Application Program can use
CICS commands to write records to storage queue.
A TST is required for recovery purposes.
04/19/23 14
Transient Data Control
Another CICS queuing facility. Records are stored in the order
they are written. Transient data has two types of
queues viz. IntraPartition & ExtraPartition.
DCT contains queue definitions
04/19/23 15
BMS - Output
Application Program has to now extract the necessary fields from the VSAM file / DB2 table that it has read and set up a map output area to be sent to the terminal.
BMS Commands formats the fields for transmission to the terminal
BMS moves the data from the map area to terminal I/O area and terminal control will pass to VTAM.
04/19/23 16
Ending the Transaction
The Transaction is ended by issuing the return Command
All storage allocated to this task is released and made available for use by other tasks.
04/19/23 17
Multi-Tasking A single task will not keep CICS
busy, and hence CICS can accept input from many terminals.
When a currently executing task ends or waiting for I/O, another task is ready to execute.
Thus, CICS can run many tasks at a time and hence, Multi-tasking.
CICS decides, which ready-to-run task to execute depending on Task-dispatching.
04/19/23 18
Multi-Threading
Because of Multi-Tasking, CICS loads one copy of the application program for each task.
Thus, many tasks share the use of the program i.e., they will multi-thread through the code.
Multi-Threading is totally transparent to the Application Programmer.
04/19/23 19
Task Termination
When Program finishes processing for a given task, it returns control to CICS. All storage associated with the task is released except for program storage TIOA
04/19/23 20
Conversational Design 1
Whole Dialogue takes place within one CICS transaction
It means all processing takes place in one CICS transaction
The transaction is initiated when the user requests the menu and is terminated when the final confirmation message is displayed.
04/19/23 21
Conversational Design 2
Task has to wait for a longer time while the user thinks & keys data.
Contravenes two important CICS design rules: Tasks should exist in system for
minimum possible time Resources should be locked and
therefore unavailable for shortest possible time
04/19/23 22
Pseudo-Conversational Design 1 Dialogue implemented as a
sequence of CICS tasks, where each task processes one message pair.
Task will terminate after sending a message to the terminal.
CICS RETURN command allows the programmer to preset the identifier to the next transaction.
04/19/23 23
Pseudo-Conversational Design 2 This invokes a task automatically
when the next input message arrives from the terminal.
This task receives the user input, process it, SEND the next output screen and presets the next transaction to be executed.
Main benefit is that the task exists for the time taken to process a message pair.
04/19/23 24
Pseudo-Conversational Design 3 Records are not locked across the
Conversation It is implemented as one
transaction to the user, but is actually implemented as more than one transaction to CICS.
This can be reduced to implement as one CICS transaction as well.
04/19/23 25
Quasi-Reentrancy Reentrancy with in CICS
environment A Program which can reenter itself
and continue processing when interrupted is a reentrant program
CICS enables it by keeping all Static Variables in Working Storage & all Dynamic Variables in Dynamic Working Storage Sections.
04/19/23 26
Execution Interface Block Lets the application developer to
Communicate with the Execute Interface Program
Contains Useful information about the terminal-id, task associated with, CICS command response code etc.
Used in application programs to access the information.
04/19/23 27
COMMAREA Storage Areas outside the program
are accessed via the Linkage Section.
Done by coding DFHCOMMAREA in Linkage Section.
Should be the first variable. Used for data transfer. This is necessary while developing
pseudo conversational programs.
04/19/23 28
Link & XCTL Commands
Used for Modularising the Design Link & XCTL are both used to pass
control from one CICS program to the other.
With Link, the Calling program expects control to come back to it from the Called program whereas the reverse is true with XCTL.
04/19/23 29
Basic Mapping Support CICS used BMS to manage
terminal Input / Output BMS provides with a set of
Assembler Macros to define and manage Terminal Input / Output
Application Developer has to know to code two Assembler Commands (PRINT & END) and three BMS instructions (DFHMSD, DFHMDI & DFHMDF).
04/19/23 30
MAP A map is just a set of code that is
used by CICS to construct the 3270 data stream format to send/receive from terminal. Maps can be developed through coding MACRO. Macro contains set of assembler commands.
MAP has two components Physical Map & Symbolic Map.
BMS macro has to be Assembled twice to create Physical as well as Symbolic Mapsets.
04/19/23 31
Physical Map Physical map set is a load module
BMS uses to map data transmitted to and received from the display station.
In other words, it can be called as load of the map. It resides in program load library along with program loads.
The Physical Map is loaded when executing program requests Send or Receive BMS services.
04/19/23 32
Symbolic Map - 1
Symbolic Map is a copy member that is copied into the program.
Defines the format of the screen data that is processed by the program.
Symbolic map resides in copy library.
04/19/23 33
Symbolic Map - 2
Symbolic map is often refereed to as DESECT which is an assembler language.
A symbolic MAP will have data fields for the length, the attribute byte & data component for each data fields excluding constant fields.
04/19/23 34
MAP Preparation
P H Y S IC A L M A PP U T IN L O A D L IB R A R Y
L IN K E D IT
A S S E B M L E R
S Y M B O L IC M A PC O P Y B O O K G E N E R A TE D
P U T IN C O P Y L IB R A R Y
A S S E M B L E R
M A P D E F M A C R O
04/19/23 35
Example of IBM-created symbolic MAP01 EMPLIN1I.
02 FILLER PIC X (12).
02 EMPNAL COMP PIC S9(4).
02 EMPNAF PIC X.
02 FILLER REDEFINES EMPNAF.
03 EMPNAA PIC X.
02 EMPNAI PIC X(21).
01 EMPLIN1O REDEFINES EMPLIN1I.
02 FILLER PIC X(12).
02 FILLER PIC X(3).
02 EMPNAO PIC X(21).
04/19/23 36
3270 Display Device Characteristics Data displayed by BMS on a 3270
terminal is organised into fields Each field is associated with
specific attributes that control its appearance and operation.
Field attributes of 3270s can be divided into two classes Standard Extended
04/19/23 37
Standard Attributes Available on all 3270 models. Occupies the character location on
the screen that is immediately before the field it affects.
Specified by a single byte, called an attribute byte.
The three Standard attributes are: Protection Attribute Intensity Attribute Shift Attribute
04/19/23 38
Extended Attributes Available on special 3270 models Don’t occupy positions on the
screen The four important Extended
Attributes are: Extended Colour Extended Highlighting Must-enter field Programmed Symbols
04/19/23 39
Modified Data Tag Last Bit in the Attribute Byte Used to indicate whether the field
should be transmitted to the host system when the operator presses an AID key.
If MDT is ON (1), the field is sent. MDT can be turned ON/OFF
programmatically. Also used for Cursor Positioning
04/19/23 40
Coding BMS Map sets BMS map set is an Assembler
Language program that consists of Macro Instructions.
When BMS macro is processed using JCL it generates Map load & Map copy book.
Assembler Language Coding rules are to be followed while coding BMS Macros.
04/19/23 41
Rules for Coding Macros
Column 1: Label (up to 7 characters) Column 10 : Macro name, followed by at
least one space. Column 17-71 : Optional keywords, each
one separated by comma with no intervening spaces
Use continuation character * in 72 column for continuation
For a comment, code * in column 1
04/19/23 42
MAP module structure
There are three macros to define a map.
DFHMSD - coded twice, this defines a MAPSET
DFHMDI - coded once for each map to be defined
DFHMDF - coded for each field to be defined.
04/19/23 43
DFHMSD-MAPSET def Means provided by CICS to package
all MAPs that a given program might use.
Name in which the (physical map) & copybook (symbolic map) would be created.
Must be defined in PPT. Syntax:
MAPSET1 DFHMSD TYPE=MAP, *
MODE=INOUT
04/19/23 44
Keywords for MAPSET TYPE=&SYSPARM|DSECT|
MAP| FINAL LANG=COBOL|ASM|PL1|C MODE=INOUT|IN|OUT TERM=term type|ALL TIOAPFX=YES|NO STORAGE=AUTO|BASE CTRL=FREEKB|ALARM|
FRSET| PRINT|length
04/19/23 45
DFHMDI-MAP definition
Defines a map within a map set Supplies map’s name and other
useful information such as its size and position
Overrides defaults specified in DFHMSD macro.
04/19/23 46
KEYWORDS for Map SIZE=(line,column) LINE=number COLUMN=number Justify = Left | Right Header = Yes | No Trailer = Yes | No EXTATT=Yes | No VALIDN = MUSTENTER |
MUSTFILL| TRIGGER
04/19/23 47
DFHMDF - MAP FIELD definition Defines the map field by specifying
its position, length and attributes Actually defines an attribute byte. To define a Protected Field,
DFHMDF macro is coded once as it needs just one attribute byte
To define an Unprotected field, DFHMDF macro is coded twice, one to mark the beginning and the other to mark the end.
04/19/23 48
MAP FIELD keywords POS = (line,column) LENGTH= number INITIAL=‘literal’ ATTRB= ASKIP |PROT |UNPROT
|BRT| DRK| NORM| NUM| FSET| IC
PICIN=‘COBOL PIC value’ PICOUT=‘COBOL PIC value’
04/19/23 49
Overriding attributes on the screen You can manage the attributes of
fields from within your program. When changing the attribute of a
field, remember that you must not just specify the attribute to change; you must specify all attributes that apply to the field. This is because attribute are bit combinations that are prepackaged in the DFHBMSCA copybook.
04/19/23 50
Assembler Commands
These statements are not required, but
they are very helpful in improving the
documentation of your listing of assembled
MAPs. TITLE - This causes a heading to
appear on each page of the assembled listing.
PRINT NOGEN - This statement tells the assembler that you do not want the generated code to appear on the listing.
04/19/23 51
STOPPER fields BMS does not automatically generate
attribute byte to mark the end of an unprotected field.
The user have to do it himself using stopper field in macro otherwise the rest of the line beyond the length of the field will become unprotected.
So after every unprotected field an unlabeled stopper field must be defined with attribute parameter as ASKIP.
So if the operator keys to end of the field, the cursor will automatically skip to the next unprotected field.
04/19/23 52
STOPPER field example
EMPNAME DFHMDF POS=(2,26)
LENGTH=5
ATTRB=(NORM,UNPROT),
DFHMDF POS=(2,32)
LENGTH=1
ATTRB=ASKIP
04/19/23 53
Logical steps that occur during a SEND MAP CICS constructs the data stream
using MAP. Data fields containing LOW-VALES are not included.
Attribute bytes from symbolic MAP will replace those in physical MAP
The first length field in the symbolic MAP that is -1 becomes the cursor position, overriding any specified in MAP
Using options in the SEND MAP command, the data stream is sent to the terminal.
04/19/23 54
Logical steps that occur during a RECEIVE MAP
CICS RECEIVES the terminal input when user presses AID (termination key)
CICS updates the EIB & then initiates the transaction identified for this terminal from the previous RETURN TRANSID command.
When the application issues a RECEIVE MAP command, CICS formats the data into the symbolic MAP identified in the RECEIVE command.
04/19/23 55
SEND MAP COMMAND EXEC CICS
SEND MAP (name)
MAPSET (name)
FROM (data-value)
LENGTH (data-value)
DATAONLY|MAPONLY
ERASE|ERASEAUP
CURSOR (data-value)
FRSET
HANDLE|NOHANDLE|RESP
END-EXEC
04/19/23 56
SEND MAP command Sends maps to the screen
Keywords used with SEND MAP are as follows: MAP (map name) FROM(data name) DATAONLY|MAPONLY MAPSET (Map set name) Cursor (Value) FREEKB, ALARM & FRSET ERASE|ERASEUP HANDLE|NOHANDLE|RESP
04/19/23 57
Exceptional Conditions with a Send Command INVREQ LENGERR NOTALLOC TERMERR
04/19/23 58
RECEIVE MAP Command
EXEC CICSRECEIVE MAP (name)
MAPSET (name)
INTO (data-area) | SET(pointer)
HANDLE|NOHANDLE|RESP
END-EXEC
04/19/23 59
RECEIVE MAP command This command receives the data
values from the terminal
Keywords used with RECEIVE MAP are as follows:
MAP, MAPSET, HANDLE : same as in SEND MAP command
SET (pointer) INTO(data name)
04/19/23 60
Exceptional Conditions for Receive Command INVMPSZ INVREQ MAPFAIL
04/19/23 61
Attention Identifier Keys on IBM Mainframe Keyboard
All PF keys from PF1 through PF24 The PA1 & PA2 keys The CLEAR key The ENTER key
04/19/23 62
Determining which Attention Identifier key is pressed
EIBAID in EIB.
If EIBAID = DFHPF3EXEC CICS RETURN END-EXEC
End-If Also Solves the MAPFAIL Error as
Follows: If EIBAID = DFHCLEAR
EXEC CICS SEND MAP End-If
04/19/23 63
Controlling Cursor on SEND
There are various ways by which you can determine the cursor position they are as follows.
One way to do it is to use IC option with DFHMDF macro.
The second way is two use CURSOR (data value) on the SEND MAP command.
But the most popular option is to move -1 in the length field of the field in which you want to place the cursor before the SEND MAP command.
04/19/23 64
CONTROLLING THE CURSOR ON RECEIVE MAP
EIBCPOSN.
cursor-position = (row -1) * 80 + column-position - 1
IF EIBCPOSN > 1130 AND < 1147
04/19/23 65
Program - Program Communication in CICS
RETURN | RETURN with trans-id LINK XCTL
04/19/23 66
RETURN COMMAND
RETURN |RETURN TRANSID(transid)
RETURN command returns control to CICS.
RETURN TRANSID command will give control to transid when the designated terminal enters data.
04/19/23 67
RETURN COMMAND Syntax EXEC CICS
RETURN (transid(name)
COMMAREA (data-area)
IMMEDIATE
END-EXEC
04/19/23 68
Exceptional Conditions with Return Command INVREQ LENGERR NOTAUTH
04/19/23 69
LINK COMMAND
LINK PROGRAM (program name) When a program is invoked by a trans-id,
there are two logical levels. Program A runs at level 1. CICS is at highest logical level 0.
Application programs can use LINK command to invoke programs at levels lower to them.
Similarly while RETRUN command is issued the will pass to immediate superior level not to CICS
04/19/23 70
LINK COMMAND Syntax
EXEC CICSLINK PROGRAM (name)
COMMAREA (data-area)
LENGTH (data-length)
TRANS-ID(name)
END-EXEC
04/19/23 71
Exceptional Conditions with Link Command INVREQ LENGERR NOTAUTH PGMIDERR TERMERR
04/19/23 72
XCTL COMMAND
XCTL PROGRAM (program-name) This command transfers control to
another program without setting up a return mechanism.
As a result control does not return to a program that issues XCTL command.
04/19/23 73
Syntax of XCTL Command EXEC CICS
XCTL PROGRAM (name)
COMMAREA (data-area)
LENGTH (data-length)
END-EXEC.
04/19/23 74
Exceptional Condition with XCTL Command INVREQ LENGERR NOTAUTH
04/19/23 75
Program to program communications commands cont..
CICS
Program. A
Program B Program C
XCTL
LINK
RETURN (without transid)
RETURN(with or without transid)Start
Level 0:
Level 1:
Level 2:
04/19/23 76
File Handling
CICS provides file handling COMMANDS for VSAM & DLI where as provide interface for SQL.
CICS provides file handling commands for following types of VSAM, KSDS, RRDS, ESDS.
04/19/23 77
FCT Entries
Filename as Used in CICS and the DD Name
File Access Method Type of Request Permitted
Read/Browse/Update/Delete
04/19/23 78
File Control Commands
READ WRITE REWRITE DELETE UNLOCK
04/19/23 79
CICS Record Processing
Direct Using: Primary / Alternate Key in KSDS RBA for an ESDS RRN for RRDS
Sequential Skip-Sequential
04/19/23 80
CICS READ Syntax
EXEC CICS
READ FILE (filename)
INTO (data-area)
LENGTH (length)
RIDFIELD (key)
UPDATE
END-EXEC
04/19/23 81
CICS Generic Key Processing Used for both Random &
Sequential Requests. Additional Options that are Used
with GKP are: KEYLENGTH GENERIC GTEQ EQUAL
04/19/23 82
CICS Sequential Browse Considerations Additonal Options used are:
STARTBR READNEXT READPREV ENDBR RESETBR
04/19/23 83
CICS Skip-Sequential Considerations Key value moved into Key option
to initiate Skip-Sequential Reading Reading from the first record can
be started by moving LOW-VALUES to RIDFLD option of the STARTBR Command
RESETBR can be used to change characteristics of the Browse Operations
04/19/23 84
CICS WRITE Syntax
EXEC CICS WRITE
FILE (file-name)
FROM (data area)
RIDFLD (key name)
LENGTH (longest record)
MASSINSERT
END-EXEC
04/19/23 85
CICS UNLOCK Syntax
EXEC CICS UNLOCKFILE (file name)
END-EXEC
04/19/23 86
CICS REWRITE Command EXEC CICS REWRITE
FILE (file name)
FROM (data area)
LENGTH (longest record)
END-EXEC
04/19/23 87
CICS DELETE Command
EXEC CICS DELETEFILE (file name)
END-EXEC
04/19/23 88
Advanced CICS
Communicating between tasks & programs
Dynamic allocation of memory Task control features
04/19/23 89
Communicating between tasks & programs
Using DFHCOMMAREA Using Queues
04/19/23 90
Using Queues QUEUES - CICS provides two two
types of queues
Transient Data Queue
Temporary Storage Queue
04/19/23 91
Uses of Queues
Online Programs need scratchpad facility to save / retrieve data records Directly / Sequentially
Data can be transferred from One Program to another, One region to another using Queues
04/19/23 92
Transient Data Queues
4 Character Destination ID Defined in DCT Sequential Retrieval Only Records cannot be Updated Types Include Intra Partition &
Extra Partition
04/19/23 93
Intra Partition TDQ
Intra Partition refers to data on tapes for use in one or more programs running as separate tasks
Uses include: Message Switching Broadcasting Database Access Data Collection
04/19/23 94
Extra Partition TDQ
Extra Partition TDQ reside on DASD that are accessible by programs that reside outside the CICS region
Uses include: Data Routing Data stored in EP TDQ is intended
to be used in other non-CICS programs
04/19/23 95
Temporary Storage Queue 8 Character Data ID Created Dynamically Direct / Sequential Retrieval Records can be Updated Uses include:
Terminal Paging Suspended Dataset Pre-printed forms
04/19/23 96
Using Queues cont.. CICS commands for Temporary Storage
Queues WRITEQ TS command - To add a record
to a temporary storage queue, you code this command. E.g
EXEC CICS
WRITEQ TS QUEUE (TSQ-NAME) FROM (TS-QUEUE-RECORD)
LENGTH(TS-QUEUE-LENGTH)
[ITEM NUMBER (TSQ-NUMBER)
REWRITE]
END-EXEC
04/19/23 97
Using Queues cont..
READQ TS command - To retrieve records from temporary storage queue, you use the READQ TS command.
EXEC CICS
READQ TS QUEUE (TS-QUEUE-NAME)
INTO (TS-QUEUE-RECORD)
LENGTH(TS-QUEUE-LENGTH)
ITEM (TS-ITEM-NUMBER) NEXT
END-EXEC
04/19/23 98
Using Queues cont..
DELETEQ TS - You must issue a DELETEQ TS command to delete a TSQ when you are finished processing it.
If you don’t, the queue remains indefinitely(till CICS is restarted) wasting valuable disk or main storage.
DELETEQ TS command deletes an entire TS queue - there is no way to delete a single record.
04/19/23 99
IBM supplied CICS transactions IBM provides various transactions
which can be used to for Providing control information Setting control information Debugging Inquiry Logon/logoff
04/19/23 100
CEDA
CEDA, CEDB & CEDC are similar CEDA has the most capacity & is
usually assigned only for system programmers because CEDA allows a user to assign, modify & install resources to a CICS system(I.e. updating of system tables.)
CEDB is as capable as CEDA with some minor changes.
CEDC is more a view facility of system information entered thru CEDA/CEDB.
04/19/23 101
CEMT
The CEMT transaction is normally used by application programmers for maintenance of their work environment.
This includes verifying that files are allocated, opening or closing files, setting programs to enable or disable status, refreshing program & map loads & similar functions.
04/19/23 102
CEDF
CEDF was designed to help programmers step through their work in a debugging mode.
CEDF does not trap each COBOL instruction, but focuses instead on every CICS command, showing the status both before & after executing the instruction.
04/19/23 103
CECI & CECS
They are called command line interpreters. CECI executes command immediately.
CECS only ensure that you coded it correctly.
04/19/23 104
CEBR
CEBR is designed to to let you browse existing storage queues & first searches for one named after your term-id with prefix as CEBR. E.g. your term-id is CT19 it would search for one named CEBRCT19.
04/19/23 105
CESN, CSSN & CESF
CESN - This transaction is used to logon to CICS.
CSSN - This is same as CESN CESF - This transaction is used to
log out off the CICS.