CICS Notes
CICS Notes
CICS
INTRODUCTION
ONLINE SYSTEM
DEFINITION : ONLINE processing allows a user to interact with a computer and access
its resources via a terminal.
Example : Railway Reservation system.
BATCH ONLINE
Input Data from card tape, disk Batched, sequential, Data from terminal random, concurrent
scheduled
Start of A job Operator (or operating system) initiates the job. Once CICS is initialized, entering
Other jobs in the same region must wait. transaction id triggers the transaction to
start.
Processing Single task single thread. Priority in job Multi task multi thread. Priority
Mode scheduling processing.
End of job Each job Each transaction. Once CICS is
terminated, no transactions can be
entered.
Output printed reports, output files. User must wait for Message terminals updated files, system
batch jobs to produce reports (day, week, Instant feed back
month)
Resource Usage Less More
Example of Monthly sales report Airline reservation system
application
WHAT IS CICS?
CICS START UP
CICS SHUTDOWN
ROLE OF CICS
MULTI TASKING
More than one task can be executed concurrently.
MULTI THREADING
Tasks share the same program under the multi tasking environment.
RE-ENTRANT PROGRAM
Program when does not modify itself in any way during execution.
QUASI RE-ENTRANT
Is a reentrant program under the CICS environment.
INTRODUCTION TO BMS
Physical Map
SYMBOLIC MAP
L Halfward binary
Contain the length of data entered by the terminal operator
F One byte flag field
I Contains the data entered by the operator
A One byte field that contains Attribute byte
O Contains data to be sent to terminal
OUTPUT MAPPING
“MAP ONLY”
EXEC CICS SEND
MAP (“mapname1’)
MAPSET (‘mapset1’)
MAPONLY
END-EXEC
“DATA ONLY”
EXEC CICS SEND
MAP (‘mapname1’)
MAPSET (‘mapset1’)
DATA ONLY.
END-EXEC.
The physical map and the data from symbolic map is sent to the terminal.
ERASE: Current screen is erased before the map specified appears on the screen
ERASEAUP: erase all the unprotected fields.
FREEKB: to free the keyboard
ALARM: to make an alarms sound.
FRSET: to reset MDT to zero
CURSOR: to place the cursor in a specified field
CURSOR POSITIONING
Static positioning
If IC option is specified in the ATTRB field of DFHMDF macro the cursor
will be placed at this field.
Dynamic / symbolic positioning.
Place (-1) into the field length field (“L” suffix). Cursor will be placed in
the field.
Dynamic / Relative positioning.
Cursor (data-value) option is used.
Data-Value will have the value at which the cursor has to be positioned.
E.g.. EXEC CICS SEND
MAP (…..)
MAPSET (…..)
CURSOR (100)
ERASE
END-EXEC.
MAPFAIL condition will caused in RECEIVE MAP command.
If the data to be mapped has a length of zero.
If the operator presses any key (clear, PA, PF, ENTER, Keys) without
entering any data.
LINKAGE SECTION
Copying a symbolic description map structure here does NOT mean the
storage will be available. Some methods for providing storage are passing
a COMMAREA, acquiring temporary storage with the SET option, or using
a GET MAIN command.
SEND / RECEIVE
SEND MAP Coding Alternatives You can code the SEND MAP command to
locate the symbolic description map in several ways:
Using constants in the name field for MAP and MAPSET(FROM is
not required)
Using variables in the name field for MAP and MAPSET (This makes
FROM a required parameter)
Using only the MAP parameter. In this case the name in the MAP
option must be the MAPSET name.
RECEIVING into the symbolic description map
RECEIVE MAP(`MAP1')
MAPSET(`SET1') ... MAP1 I
Move `MAP1' to MAPVAR
Move `SET1' to SETVAR ..... MAP1 I
RECEIVE MAP (MAPVAR)
MAPSET(SETVAR)
INTO (MAP1 I)
Receive MAP (`SET1') ... SET1 I
RECEIVE MAP coding alternatives You can code the RECEIVE MAP
command to locate the symbolic description map in several ways:
Using constants in the name field for map and mapset (INTO/SET
is not required) This is the most commonly used format.
Using variables in the name field for MAP and MAPSET. This makes
INTO (database) or SET a required parameter.
Using only the MAP parameter. In this case the name in the MAP
option must be the MAPSET name.
Linkage Section.
01 DFHCOMMAREA
01 LST
02 PTR-2-LIST PIC S 9(8) COMP.
02 PTR-2-BMS PIC S 9(8) COMP.
RECEIVE MAP (`MAP1') MAPSET (`SET1')
SET (PTR-2-BMS) ..... MAP1 I
Using the SET option requests CICS to get the storage and return a
pointer to it. The symbolic description map must be in the
LINKAGE SECTION.
OUTBOUND FUNCTIONS
Control Functions:
Typically the first type of command in the program is a SEND MAP. Certain
control functions may be included in that command.
ERASEAUP will clear out each field whose attribute is unprotected. It will NOT
alter any attribute settings.
If you do not free the keyboard using FREEKB, the operator will have to press the
RESET key before entering data.
If you code FRSET, all attribute bytes currently having Modified Data Tags (MDT)
set on will be set off. Selective resetting of the MDT's must be done another
way.
When sending data to a 3270 screen the actual printing from the buffer will
occur when the PRINT function is requested.
Attributes :
The `A' suffixed field is an attribute field which controls the following:
PROTECTED/UNPROTECTED
ASKIP
NUM
MDT
Non Display (dark)DISPLAY (normal/bright)
EXTENDED ATTRIBUTES
DSATTS (for symbolic map) and MAPATTS (for physical map) support the
extended attribute characteristics
The MAPATTS allows you to set up the physical map with any of the
characteristic(s) coded.
The DSATTS will create appropriate suffixed labels for the attribute
characteristic(s) coded.
EIBAID/CURSOR
WORKING-STORAGE SECTION.
COPY DFHAID.
......
PROCEDURE DIVISION.
IF EIBAID = DFHPF12 THEN
......
IF EIBAID = DFHENTER THEN
......
IF EIBCPOSN LESS THAN 80 THEN
......
When you first enter your program as a result of a transaction id, you can test
EIBAID and/or EIBCPOSN. This may be done prior to issuing a RECEIVE
command, if so chosen.
If the operator uses any PA key or presses the CLEAR key, no data is transmitted
EIBAID is useful when function keys are defined for the user.
for eg. PF12 may be the exit function
PF3 may be an update function etc.
Thus testing for the type of AID will alter the logic flow.
EIBCPOSN can be used to determine where the cursor was positioned on the
screen. This information is especially useful with screens containing an action
bar.
CURSLOC
Sample Map
EDITING
If PICIN/PICOUT is not coded in the macro, the pic generated is always PIC X
(length of field)
By using PICIN/PICOUT BMS can be forced to generate the appropriate PIC.
PICIN tells BMS how to move data into the `I' suffix field.
PICOUT tells COBOL how to edit your data move to the `O' suffix field.
BIF DEEDIT is used to remove the special characters from the input field.
The Amount field displayed has a dollar sign and a decimal point
By using BIF DEEDIT dollar sign and decimal point is removed. Thus the number
can be used for arithmetic operations.
COBOL compiler requires LENGTH specification:
VS COBOL-II uses the implied length of the data-area used in the field
parameter.
OBJECTIVES
Identification Division
Program - ID required
Environment Division
Other requirements:
COBOL statements and CICS commands should be coded
The following COBOL statements are prohibited.
ACCEPT, CURRENT-DATE, DATE, DAY, DISPLAY, EXHIBIT, STOP RUN, TRACE
Any I/O Statements(OPEN, CLOSE, READ, WRITE, REWRITE, DELETE, START)
REPORT WRITER feature
SORT feature
CALL statement is allowed if the called program does not issue any CICS
commands or inhibited COBOL statements mentioned above.
TERMINATION STATEMENTS
Notes :This is not the way to terminate a CICS program. CICS has a command for that
purpose. Nevertheless, COBOL and VS COBOL II have three statements to conclude
programs.
Control must not be allowed to pass beyond the last statement of a CICS
Program.
STOP RUN in COBOL uses operating system facilities, and therefore, is
discouraged.
EXIT program is ignored if the program has not been called.
CICS RETURN COMMAND and/or GOBACK statement is recommended.
Transactions
Task
Program
Transactions
Task
Program
Prepared statements compiled or assembled into an executable module of machine
instructions.
CONVERSATIONAL TRANSACTION
The task is terminated after a message is sent with a linkage for the next task.
CICS provides a facility (COMMAREA) to made it easier to accomplish this.
When the user completes response (by pressing enter) reset task is
automatically initiated by CICS.
The task receives the message from the terminal & processes it.
This is a multitask operation from system's point of view.
PROGRAM PREPARATION
Running the DB2 precompiler first is the preferred method. DB2 precompiler
precedes another process, binding, not mentioned here.
Output of the DB2 precompiler can serve as input to the translator.
Output of the translator will be input to the compiler.
Messages or warnings are provided on all the listings.
TRANSLATOR recognizes EXEC CICS and EXEC DLI statements. They are
commented out and replaced with statements in the appropriate language.
Here, COBOL MOVE instructions and a CALL are inserted and passed on to the
COBOL compiler.
DB2 Precompiler is supplied by the relational data base managers, DB2 and
SQL/DS. It recognizes EXEC SQL statements which it will comment out and
replace with in our case. COBOL PERFORM and CALL statements.
Output of the transaction is i/p to the compiler
The o/p of the linkage editor is executable. The load module is placed in the
CICS online program library.
Messages or warnings are provided on all the listings. The compiler listing is or
limited use if the translator listing would not process all commands.
TESTING
CEMT set program (prg1) New comp
Or
CEMT S PR (prg1) N
After making changes to a program the new version replaces old version, but
CICS which is currently executing has no way of knowing this automatically. The
CICS processing program table PPT still points to the old-version.
To avoid testing with the old version, you must use the CICS-provided CEMT
transaction to update the pointer to the program.
COMMON FORMAT
ARGUMENT VALUES
01 Record-area.
05 Fld 1
05 Fld 2
name COBOL data name Character string
label Paragraph name
hhmmss PIC S9(7) comp 3
Packed decimal
pointer-ref BLL cell
Usage pointer
RECEIVE COMMAND
EXEC CICS RECEIVE
INTO (data area)
LENGTH(ml)
END-EXEC
RECEIVE command is used to receive incoming data from the terminal to which
this CICS transaction is associated.
A receiving area must be defined in working storage section and has to be
specified in the INTO parameter.
Length field must be defined in working storage section as a S9(4) comp. It has
to be specified in length option.
SEND COMMAND
The data to be sent must be stored in working storage section, and this field
name has to be specified in the FROM parameter.
Length must be specified the same as that of the Receive command.
EXCEPTIONAL CONDITIONS
RESP option
Define a full word binary field S9(8) comp in the working storage section
as the response field.
Place RESP option with the response field in any CICS command.
After command execution, check the response code in the response field
with DFHRESP (xxxx)where xxxx is
NORMAL for normal completion or Any exceptional condition
HANDLE CONDITION
NO HANDLE OPTION
ASKTIME Command
used to request the current date and time
EIBDATE and EIBTIME fields have the values at the task initiation time.
FORMAT EXEC CICS ASKTIME END-EXEC
DELAY COMMAND
used to delay the processing of a task for the specified time interval or until the
specified time.
FORMAT
EXEC CICS DELAY
INTERVAL (002000)
TIME (152000)
End - EXEC
COMMAREA
PSEUDO CONVERSATIONAL
Notes :
The first time commarea is passed, it must begin as an area of storage in
the working storage section of the program passing it.
A commarea parameter in the RETURN will pass the area to the program
associated with the subsequent transaction. In this case, itself.
The subsequent program (in this case the same program) must define
access to all the commarea that was passed to it.
PAYROLL as both the sender and the receiver of the COMMAREA needs the
working storage definition to send and the linkage section DFHCOMMAREA to
receive.
PAYROLL must therefore be able to distinguish between FIRST TIME into the
program. When there is no COMMAREA and subsequent times in. Where one
exists in the Linkage section. The EIB field, EIBCALEN indicates the length of the
commarea.
EIBCALEN
To pass control from one program to another and then return to the original like
executing a subroutine.
The link command passes control to another program defined in CICS PPT
expecting that the program will return to the linking program instruction
following the LINK command. This happens when the linked program issues a
RETURN command.
Data may be passed using the commarea.
The commarea is shared between the two program regains control may changes
made to the commarea by the linked program are accessible.
The two programs executive under the same task.
The working storage section for the linking program is retained. Working
storage for the linked program is automatically released after its RETURN
command is executed.
To pass control from one program to another and then return to the original like
executing a subroutine.
The link command passes control to another program defined in CICS PPT
expecting that the program will return to the linking program instruction
following the LINK command. This happens when the linked program issues a
RETURN command.
Functional overview
DIRECT RETRIEVAL
VSAM DATA STRUCTURES
DIRECT RETRIEVAL
RELATIONAL TABLE ROW
BROWSE
VSAM DATA STRUCTURE
BROWSE
RELATIONAL TABLE ROWS
Entry for VSAM file has to be there in FCT (File Control Table)
Each entry contains all descriptive information for the file it represents. So,
programmer need not define the physical organization and other attributes of
the files.
The File parameter coded in the program must be the same as the file
name in the FCT.
Interface between CICS and Relational Database is called CICS attachment
Facility. Statement are coded in SQL language in the application program
to Communicate data requests to the database.
TOPICS
DIRECT RETRIEVAL
VSAM FILE RECORD
RELATIONAL TABLE ROW
BROWSE
VSAM FILE RECORDS
SET OF RELATIONAL TABLE WORKS
PROGRAM ORGANIZATION
RECORD IDENTIFICATION
RECORD KEY
RELATIVE BYTE ADDRESS
RELATIVE RECORD NUMBER
PARTIAL KEY
key of the record to be read is specified in the RIDFLD. for KSDS
Key specified can be a full key or partial key
If partial key, key length has to be provided
RBA (Relative Byte Address)
Can also be used instead of actual key value
For ESDS
RIDFLD contain a 4 byte RBA
For RRDS
RIDFLD contains 4 Byte binary relative record number.
RIDFLD must be set to the value of the key of the record to be retrieved.
RIDFLD must be large enough to hold a full record key even when a partial key is
used.
READ COMMAND
EXCEPTIONAL CONDITIONS
The exceptional condition can be trapped using RESP option in the READ command.
ADDRESSABILITY TECHNIQUES
a module given control through the use of a CICS XCTL command will not return
to the program that issued the XCTL.
The required. program name is character string constant (max 8 characters)
The PGMIDERR exception condition occurs when the name is not in the PPT.
LOGICAL LEVELS
The linked to program runs at a new logical level and returns to a logical level
back to the linking program.
The linking program and its storage area remain available.
Notes :
To quit the repeated execution simply RETURN without the TRANSID option.
Any linked program could use the same COMMAREA of the parameters so
indicated.
The transid & commarea option easy enough to use to make this method
practical.
CICS LINK
CICS XCTL
COBOL CALL
Alternative to XCTL or LINK ? COBOL CALL·
COBOL CALL passes control to other programs.
INPUT MSG & INPUT LEN PARAMETERS USED WITH XCTL OR LINK.
Receiver uses EXEC CICS RECEIVE command
ADDRESSABILITY
All Intra partition TDQ are stored in only 1 physical file (VSAM)
Extra partition TDQ is a separate physical file & may be a disk, tape or reporter.
DCT determines the initial open / close status of a file while the file can be
opened or closed through the master terminal transaction during CICS session.
TDQ can be defined as an Input or output but not both.
Records are fixed, variable, blocked or unblocked.
EXCEPTIONAL CONDITIONS
TEMPORARY STORAGE
TSQ is a queue of stored records.
Created & deleted dynamically by application program.
Used as a scratch pad
Queue ID is of length 1-8 bytes
TSQ is of variable length
Records can be stored in main or auxiliary storage
The records once written remains accessible until the
entire TSQ is deleted
Records can be read sequentially or directly
Records can be re-read & updated.
WRITEQ TS
READQ TS
DELETEQ TS of TSQ
EXEC CICS
DELETEQ TS
QUEUE (NAME)
END-EXEC.
All records is TSQ are deleted.
All associated storage is released.
EXCEPTIONAL CONDITIONS
For invoking CECI, type CECI with the CICS command to be interpreted.
CEBR can be invoked while you are already in the CEDF mode.
Press the PF5 key to display the working storage section.
Then, press PF12 key to invoke CEBR.
CEBR allows to browse information in Temporary Storage (TS) queues.
Help (PF1) give you a list of CEBR commands on the screen.
TS queues are retained until purged.
EXCEPTION HANDLING
CICS to respond to exceptional conditions in one of three ways:
RESP option: - The RESP option can be specified in any CICS command. Its
function is similar to the return code in the batch program.
Define a fullword binary field (S9(8)COMP) in the working storage section
as a response field.
Place the RESP option with the response filed in a command.
After command execution, check the response code in the
response field with DFHRESP (xxxx), where xxxx is the - NORMAL
- Any exceptional condition
HANDLE CONDITION This command is used to transfer control to the procedure
label specified if the exceptional condition specified occurs.
IGNORE CONDITION This command causes no action to be taken if the
condition specified occurs in the program.
EXEC CICS HANDLE CONDITION
Condition (Label)
[Condition (Label)]
[Error (Label)]
END-EXEC.
or
EXEC CICS IGNORE CONDITION
Condition
[Condition]
END-EXEC.
ABEND CODE
CICS Adend Codes :- Execute Interface Block and cics abend codes
Some of the more common CICS abends are briefly described below. These are only brief descriptions
and do not cover all possible reasons.
ASRA
This is the most common abend in CICS. It indicates a Program Check Exception, roughly equivalent to
having an S0C7 in a batch program. Check for spaces in a packed decimal numeric field and changes to
the file and record layouts.
AEIx and AEYx
There are numerous abends that start with AEI or AEY. They indicate that an exception has occured, and
RESP (or NOHANDLE) is not is use. The last character indicates the exact error
AEI0
indicates a PGMIDERR.
AEI9
is a MAPFAIL condition,
AEIO
AEIN
AEID
AEIS
AEIP
AEY7
AICA
This abend usually occurs if your program is looping. There are CICS parameters that determine how
long a task can run without giving up control. The ICVR parameter in the CICS SIT table can be used to
specify a value for all tasks running in CICS, or you can specify a RUNAWAY value when you define a
transaction . If a program is looping then you may not get an AICA abend, because the timer can be reset
when certain events occur, eg some EXEC CICS commands may reset the timer to zero.
ATCH and ATCI
These abends indicates that the task was purged. The task may have been purged by someone issuing a
CEMT command to purge the task, or by CICS because the Deadlock timeout limit has been exceeded or
because there was not enough virtual storage available to run all the tasks in CICS (Short on Storage)
APCT
A program was not found or was disabled. Check the transaction definition to see if the program name
was misspelled. Check that the program is enabled. Check that the program is in an appropriate Load
Library (i.e., one defined to the current CICS system).
These abends indicate that a timeout of the task occurred. This may be due to a deadlock.
AFCA
ABM0
The specified map was not found in the specified mapset. Check that you have not misspelled the map
name.
The Execute Interface Block (EIBLK) contains a variable called EIBFN. This contains a value that tells
you what CICS command was last executed. This value can be displayed as part of an error message, to
aid in the debugging of your code or when an exception condition occurs
Code Command
0202 ADDRESS
0204 HANDLE CONDITION
0206 HANDLE AID
0208 ASSIGN
020A IGNORE CONDITION
020C PUSH
020E POP
0210 ADDRESS SET
0402 RECEIVE
0404 SEND
0406 CONVERSE
0408 ISSUE EODS
040A ISSUE COPY
040C WAIT TERMINAL
040E ISSUE LOAD
0410 WAIT SIGNAL
0412 ISSUE RESET
0414 ISSUE DISCONNECT
0416 ISSUE ENDOUTPUT
0418 ISSUE ERASEAUP
041A ISSUE ENDFILE
041C ISSUE PRINT
041E ISSUE SIGNAL
0420 ALLOCATE
0422 FREE
0424 POINT
0426 BUILD ATTACH
0428 EXTRACT ATTACH
042A EXTRACT TCT
042C WAIT CONVID
042E EXTRACT PROCESS
0430 ISSUE ABEND
0432 CONNECT PROCESS
0434 ISSUE CONFIRMATION
0436 ISSUE ERROR
0438 ISSUE PREPARE
043A ISSUE PASS
043C EXTRACT LOGONMSG
043E EXTRACT ATTRIBUTES
0602 READ
0604 WRITE
0606 REWRITE
0608 DELETE
060A UNLOCK
060C STARTBR
060E READNEXT
0610 READPREV
0612 ENDBR
0614 RESETBR
0802 WRITEQ TD
0804 READQ TD
0806 DELETEQ TD
0A02 WRITEQ TS
0A04 READQ TS
0A06 DELETEQ TS
0C02 GETMAIN
0C04 FREEMAIN
0E02 LINK
0E04 XCTL
0E06 LOAD
0E08 RETURN
0E0A RELEASE
0E0C ABEND
0E0E HANDLE ABEND
1002 ASKTIME
1004 DELAY
1006 POST
1008 START
100A RETRIEVE
100C CANCEL
1202 WAIT EVENT
1204 ENQ
1206 DEQ
1208 SUSPEND
1402 WRITE JOURNALNUM
1404 WAIT JOURNALNUM
1602 SYNCPOINT
1802 RECEIVE MAP
1804 SEND MAP
1806 SEND TEXT
1808 SEND PAGE
180A PURGE MESSAGE
180C ROUTE
180E RECEIVE PARTN
1810 SEND PARTNSET
1812 SEND CONTROL
1C02 DUMP
1E02 ISSUE ADD
1E04 ISSUE ERASE
1E06 ISSUE REPLACE
1E08 ISSUE ABORT
1E0A ISSUE QUERY
1E0C ISSUE END
1E0E ISSUE RECEIVE
1E10 ISSUE NOTE
1E12 ISSUE WAIT
1E14 ISSUE SEND
2002 BIF DEEDIT
4802 ENTER TRACENUM
4804 MONITOR
4A02 ASKTIME ABSTIME
4A04 FORMATTIME
5602 SPOOLOPEN
5604 SPOOLREAD
5606 SPOOLWRITE
5610 SPOOLCLOSE
5E06 CHANGE TASK
5E22 WAIT EXTERNAL
5E32 WAITCICS
6A02 QUERY SECURITY
6C02 WRITE OPERATOR
6C12 ISSUE DFHWTO
7402 SIGNON
7404 SIGNOFF
7406 VERIFY PASSWORD
7408 CHANGE PASSWORD
7E02 DUMP TRANSACTION