Sei sulla pagina 1di 22

Customer Information Control System

Ritesh Dubal
Agenda for Day 3

1. Use of DFHCOMMAREA and Execute Interface block.

2. Programming strategies for developing online applications


using CICS.
(a) Non Conversation Mode.
(b) Conversation Mode.
(c) Pseudo-conversation Mode. Techniques 1, 2 and 3.

3. Program control using LINK and XCTL commands.

4. Interval control using ASKTIME and FORMATTIME.


DFHCOMMAREA

 It is a special memory area provided by CICS to every


task.

 It is to be defined in the LINKAGE SECTION of


the called program at 01 level as DFHCOMMAREA.

 It is like a scratch pad. It can be used to pass data


from one program to another program either within
the same transaction or from different transactions.
 It can have any number of fields, but with a restriction
on the total size.
Execute Interface Block (1 of 2)

The Execute Interface Block (EIB) is a control block that


is automatically loaded by CICS for every program.

The EIB is unique to a task and contains a set of system


related information corresponding to the task. An
application program can use the fields of the EIB right
away.
Execute Interface Block (2 of 2)
The following are the details of some frequently used fields in the EIB.

Field Picture clause Information contained

1. EIBAID X Attention identifier


2. EIBCALEN S9(4) COMP Length of DFHCOMMAREA
3. EIBDATE S9(7) COMP-3 Date of task creation
4. EIBRCODE X(6) Response code of last command
5. EIBTASKN S9(7) COMP-3 Task number

6. EIBTIME S9(7) COMP-3 Time of task creation

7. EIBTRMID X(4) Terminal identifier

8. EIBTRNID X(4) Transaction identifier


CICS Features

1. Multitasking

This feature of operating system allows more than one task to be executed
concurrently. CICS schedules the task in its own region.

2. Multithreading

This feature of the operating system allows more than one task to be
executed concurrently sharing the same program. Multithreading is
a subset of Multitasking.
CICS Restrictions

Re-entrancy

A Re-entrant program is one which does not modify itself and can

re-enter to itself and continue processing after an interruption by

the operating system.

Quasi-reentrancy

A Quasi-reentrant program is re-entrant program under CICS

environment.
What is a Conversation?

Sending a message to the terminal and receiving a response


from the user is known as conversation. An application
program accomplishes a conversation by a pair of SEND
and RECEIVE commands.

Example: Display a menu on the screen and receive an


option from the user.
Classification of CICS Programs

1. Non Conversational Program

2. Conversational Program

3. Pseudo Conversational Program

(i) Technique 1

(ii) Technique 2

(iii)Technique 3
Non Conversational Program

It is a program that does not require human intervention


for inputs during execution. All the inputs are provided
when the program is started. It is similar to a program that
runs in the batch mode and hence is rarely developed
using CICS.
Conversational Program
In this case the following events can be traced.

1. The system sends a message to the screen.

2. The system waits for the user input. The time that the user takes to
acknowledge is called the Think Time. This time is considerably
high and hence is identified as a major draw back.

3. The user gives the input which is received by the system.

4. The system processes the user’s input and sends the output.

Note: In conversation mode the program is loaded at the beginning and


it is kept in memory till the transaction is finished. All resources
held till the end of transaction.
Pseudo Conversational Programs
In this case the following sequence of events takes place.

1. The system sends a message and terminates the transaction specifying


the transaction to started when the user input is received.

2. The system allocate resources to other transaction.

3. The systems polls for terminal input at regular intervals of time.


Receives the user input and starts the transaction specified.

Note: In this case the program is loaded into main storage when required
and released when not in use.
Returning Program Control
The control can be transferred back to the main program
using the RETURN command in either of the following
ways.

FORMAT 2 FORMAT 3

EXEC CICS RETURN


EXEC CICS RETURN TRANSID(next-trans-id)
COMMAREA(ws-Commarea)
TRANSID(next-trans-id)
LENGTH(Commarea-length)
END-EXEC. END-EXEC.
Demonstration of

Pseudo-conversation programs
Techniques of Pseudo Conversation
Technique 1. Multiple programs and Multiple transactions.

Technique 2. Single program and Multiple transactions.

Technique 3. Single programs and Single transaction.

Note: The following are the advantages of pseudo-conversation


programming technique.
1. Better resource utilization.
2. Looks as if it is in conversational mode.
3. Better response time.
Break
Transferring Program Control

The control can be transferred from one program to another


using either of he following two commands.

1. LINK 2. XCTL

EXEC CICS LINK EXEC CICS XCTL


PROGRAM(pgm-name) PROGRAM(pgm-name)
COMMAREA(ws-commarea) COMMAREA(ws-commarea)
LENGTH(ws-commarea-length) LENGTH(ws-commarea-length)
END-EXEC. END-EXEC.

Note: The control is expected back. Note: The control is not expected back.
Logic Levels

CICS Logic Level 0

Pgm 1
LINK Pgm 2
Logic Level 1
RETURN

Pgm 2 Pgm 3
XCTL Pgm 3 LINK Pgm 4 Logic Level 2
RETURN

Pgm 4
LINK Pgm 4 Logic Level 3
RETURN
LINK Vs. XCTL
XCTL
LINK
1. Transfers the control to a
1. Transfers the control to a
program that is at the same
program that is one logical
logical level.
level down.
2. Doesn’t expects the control
2. Expects the control back
back from the XCTLed
from the LINKed Program.
Program.
3. Since control is expected
3. Since control is not expected
back, more over-head to
back, less over-head to the
the system.
system.
4. The HANDLE conditions
4. The HANDLE conditions
are available to the LINKed
are available to the LINKed
programs.
programs.
5. LINKed program can not
5. XCTLed program can be
be Pseudo-conversational.
Pseudo-conversational.
LINK Vs. XCTL

CALL LINK/XCTL
1. Linkedited along with the main
module. 1. Separately compiled and link
edited.
2. Static Loading and hence faster
execution time, but requires 2. Dynamic loading and hence
more memory. slows down the execution speed.
3. Single copy can not be used. 3. Single copy be shared.
4. Any changes in this require
compiling of all other modules 4. Changes in this will not effect
using this. other modules using this.

5. A CALLed program remains 5. A LINKed or XCTLed program


in the last used state after it always brings a NEW copy.
returns control.
ASKTIME command
The ASKTIME command is used to request the current date and
time. The EIBDATE and EIBTIME fields have the values at the
task initiation time. Upon the successful execution of ASKTIME
command, these fields will be updated to have the current date
and time.

EXEC CICS ASKTIME


ABSTIME (WS-TIME)
END-EXEC

where WS-TIME is PIC S9(16) COMP.

This command returns the number of milliseconds that has


elapsed from 1900 A.D.
FORMATTIME command
The FORMATTIME command is used to receive the information

of date and time in different formats.

EXEC CICS FORMATTIME


ABSTIME (WS-TIME)
TIMESEP(‘:’)
DDMMYY (WS-DATE)
DATESEP (‘/’)
DAYOFWEEK (WS-DAY-OF-WEEK) [ 0 to 6 ]
DAYOFMONTH (WS-DAY-OF-MONTH) [ 1 to 31 ]
DAYOFYEAR (WS-DAY-OF-YEAR) [1 to 12 ]

END-EXEC

where WS-TIME has PIC X(8) and WS-DATE has PIC X(8).

Potrebbero piacerti anche