Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. CICS Overview:
What is CICS
CICS is an OLTP (Online Transaction Processing) environment.
CICS appears to be a separate environment but is actually a JOB that runs under the main OS
(OS/390, Z/OS).
Customer Information Control System Features:
Transaction management
Data management for DBs and files
Terminal and Screen handling
Abnormal and Exception condition handling
Logging / journaling
History of CICS
Before 1960s, Online systems were developed on a custom made basis involving OS,
Tele communication access methods, data access methods, and application programs
Macro level CICS : Application programs used the assembler-macro type CICS macros
for requesting CICS services
Characteristics of CICS
Multitasking:
Multitasking means the O/S allows more than one task to be executed concurrently, regardless
of whether the tasks use the same program or different programs.
CICS manages multitasking of CICS tasks within its own region. i.e. CICS provides multitasking
environment where more than one CICS task run concurrently.
Multithreading:
A program is shared by several tasks concurrently under Multitasking environment.
It is subset of Multitasking.
CICS manages multithreading of CICS tasks within its own region.
CICS provides the Multithreading Environment where more than one CICS task which uses the
same program, run concurrently.
Reentrant:
A Program which does not modify itself so that it can re-enter to itself and continue processing
after and interruption by the O/S. These are also known as Re-enterable Programs or Serially
reusable Programs.
It ensures the uniqueness of the data area and Programming logic to each task based on a
certain programming convention.
A program which modify itself so that it cant re-enter to itself is called a Non-reentrant
Program so it cant be used in Multithreading Environment.
Example: Batch Programs.
Conventions used by Reentrant programs:
Constants in Working-storage :
A Reentrant Program defines only Constants in its Working-Storage Section.
These constants will never be modified and shared by the Tasks.
Variables in Dynamic Working-Storage (DWS).
A Reentrant program acquires a unique storage area (DWS) dynamically for each task
by issuing GETMAIN.
All variables will be placed in DWS for a task.
Restriction on Program Alteration
A program must not alter the program itself.
If it alters itself after a Supervisor Call (SVC), it must restore the alteration to the original
before the next SVC.
Quasi Reentrant:
The Conventions used by the QRP is same as Reentrant program except for the
following one difference.
To acquire a DWS in Reentrant, O/S will issue a GETMAIN whereas in QRP,
CICS issues its own commands equivalent to GETMAIN.
Transaction Concepts:
A transaction can be thought of as a unit of work, it can be as simple as a single program that
performs an update or returns the result of an enquiry or involves complex multi-program
structure to complete the unit of work.
Transaction Types
1) Non-Conversation Transaction: The Non-conversational mode does not involve any
conversation with terminal user. There are two ways of initiating non conversational
transaction
Example: Report printing, Message switching.
2) Conversational Transaction: In this mode, when a program attempts a conversation with
the terminal user, it sits idle while it waits until the user responds, holding resources
unnecessarily. While a conversational program waits for user input, the task associated with
that program must remain in storage. Only after the completion of user response does the
program proceed to the next processing
3) Pseudo Conversational Transaction: The programming technique in which the task will not
wait for the end-user replies on the terminal. Terminating the task every time the application
needs a response from the user and specifying the next transaction to be started when the
end user press any attention key (Enter, PF1 through PF24, PA1,PA2 and Clear) is pseudoconversational processing. A pseudo-conversational program ends after it sends data to a
terminal, and some of the resources used by the program are released. CICS restarts the
program when the user completes an entry and presses one of the terminals attention
identifier (AID) keys.
CICS System programs and Tables:
PCT:
*
*
*
*
*
EXEC CICS
RECEIVE MAP('INQMAP1')
MAPSET('INQSET1')
INTO(INQMAP1I)
END-EXEC.
MOVE '..}............00109 ' TO DFHEIV0
MOVE 'INQMAP1' TO DFHC0070
MOVE 'INQSET1' TO DFHC0071
For signing on to CICS region, the CICS-Supplied Transaction CESN or CSSN can be
used, which prompts the sign-on screen
CSSN: is a conventional sign-on transaction. The password for CSSN is constant unless
is manually changed.
CESN: Is the new sign-on transaction with External Security Manager (ESM). The
password for CESN will expires automatically in the specified period through ESM.
For Sign-off from the CICS region, the CICS Supplied Transaction CSSF or CESF.
A transaction is started in CICS by entering a 4 character transaction id. When you enter
the transaction id, this starts the program associated with that transaction id.
This is a complex process involving CICS control programs and control tables.
When a transaction identifier and data are entered in a terminal, TCP with TCT
recognizes incoming data from the terminal.
TCP places the data from the terminal into TIOA and sets the pointer into TCT entry of
the terminal.
TCP passes control to KCP, which realizes the transaction identifier in the data in TIOA.
KCP through PCT finds the application program associated with the transaction.
KCP passes control to PCP, which fetches the application program from the load library
and places it into the main storage.
By a 3270 attention identifier. For the IBM 3270 type terminals, any of the PF
keys and PA keys could be defined in PCT to initiate a CICS transaction.
For signing on to CICS region, the CICS-Supplied Transaction CESN or CSSN can be
used, which prompts the sign-on screen
CSSN: is a conventional sign-on transaction. The password for CSSN is constant unless
is manually changed.
CESN: Is the new sign-on transaction with External Security Manager (ESM). The
password for CESN will expires automatically in the specified period through ESM.
For Sign-off from the CICS region, the CICS Supplied Transaction CSSF or CESF.
CEMT (Master Terminal Transaction):
This is used to manipulate the CICS environment, Such as transactions, Programs, Files,
TSQs, and tasks.
EIB Example:
The following is an example of using EIB information in an application program.
PROCEDURE DIVISION.
:
IF EIBTRMID = CRT1
GO TO ROUTINE-CRT1.
IF EIBTRNID = INQ1
GO TO ROUTINE-INQ1.
Execution results:
If the terminal identifier is CRT1 control will be passed to the paragraph
ROUTINE-CRT1.
If the transaction identifier is INQ1 control will be passed to the paragraph
ROUTINE-INQ1.
Handle condition:
It is used to transfer control to the procedure label specified if the exceptional condition specified
occurs.
EXEC CICS HANDLE CONDITION
condition (label)
END-EXEC.
The general error condition (ERROR) can be specified within the same list to specify that all other
conditions cause control to be passed to the label specified.
Example:
EXEC CICS HANDLE CONDITION
QIDERR(QIDERR-RTN)
MAPFAIL (MAPFAIL-RTN)
ERROR (COMMON-ERR-RTN)
END-EXEC
Maximum of 12 Conditions can be specified in one HANDLE CONDITION.
Ignore Condition:
It causes no action to be taken if the condition specified occurs in the program. i.e. the control will
be returned to the next instruction following the command which encountered the exceptional
condition.
EXEC CICS IGNORE CONDITION
condition
END-EXEC.
Example:
EXEC CICS IGNORE CONDITION
LENGERR
END EXEC.
EXEC CICS RECEIVE
LENGTH(------)
:
END-EXEC.
4. Program Control:
EXAMPLE:
WORKING-STORAGE SECTION.
01 WS-COMMAREA.
05 WS-COM-FIELD1 PIC X(50).
05 WS-COM-FIELD1 PIC X(50).
.
.
EXEC CICS XCTL
PROGRAM (TESTPGM)
COMMAREA(WS-COMMAREA)
LENGTH(WS-CALEN)
END-EXEC.
At the completion of the XCTL command, control will be passed to the program TESTPGM with 100 bytes of data in
WS-COMMAAREA.
COMMAREA:
Data can be passed to a called program using the COMMAREA option of the LINK or
XCTL command in a calling program.
The called program may alter the data content of COMMAREA and the changes will be
available to the calling program after the RETURN command is issued in the called
program .
COMMAREA must be defined in the Working storage of the calling program and in
LINKAGE SECTION in called program.
Length must be specified in LENGTH parameter . EIBCALEN determines whether
COMMAREA was sent by the calling program. If is greater than 0, COMMAREA was
sent. This should always be checked.
EXAMPLE
WORKING-STORAGE SECTION.
:
LINKAGE SECTION
01 DFHCOMMAREA.
05 LK-FIELD1
PIC X(50).
05 LK-FIELD2
PIC X(50).
.
RETURN:
The RETURN command is used to return control to the next higher logical level, or CICS itself if
this is the highest logical level. The format of this command is as follows:
EXEC CICS RETURN
[TRANSID(name)]
[COMMAREA(data-area)]
[LENGTH(data-area) ]
END-EXEC.
Base Locator for Linkage (BLL):
Base Locator for Linkage is an addressing convention used to address storage outside
the working storage section of an application program.
o Advantages are
- Saves the size of the application program
- Improves the performance
The parameter list must be defined by means of 01 level data in the linkage section. This
is the first definition if DFHCOMMAREA doesnt exists.
The parameter list consists of a group of address pointers, each of which is defined as
full word binary filed ( S9(8) COMP ). The parameter list is followed by a group of 01
level data definitions.
The first address pointer of the parameter list is setup by CICS for addressing the
parameter itself.
Service Reload :
This is used to ensure the addressability to a particular area defined in the linkage section.
Applications of BLL:
1. CICS command with SET option
2. Accessing CICS system areas
ADDRESS register:
This is the improvement in VS COBOL II where in addressability can be achieved through
a special ADDRESS register. This doesnt need the construction of BLL cells.