You are on page 1of 49

IMS DC

Objective:To provide an insight into the


fundamentals of IMS DC
Course Details

No:
Name : IMS DC Fundamentals
Introduction : This material Explains
Online processing that can
be handled using IMS DC.
Course Details
Pre-Requisite Knowledge of IMS DB

Target To be decided by the CR


Audience and SWS
Mode of Class Room
Training
Evaluation Attendance > 80 %
Criteria and/or
(Case study Completion
or Test score > 70%)
Lesson Plan

M# Topic Time(hrs)
1 Introduction 2
2 IMS-DC processing 3
3 MFS Facilities 2
4 Advanced IMS-DC topic 2
5 Error Handling in IMS 2
6
Module 1- Introduction
An Introduction to IMS :
IMS is a Hierarchical DBMS, supplied by IBM
& runs on Mainframe Computers, has 2 main
Functions:
 Data Base (DB) Processing
 Data Communication (DC) Processing.
• Interactive Programs

– What is Online Processing


– Differences between Batch & Online Processing
– Major Kinds of Online Programs that can be written
IMS Data Communication(DC) Basic:

Input Message
Terminal IMS DC
Program Process Database
Output Message
• IMS/VS forms a layer in between the Terminal
and the IMS-DC programs, this helps in
asynchronous mode of communication.
• Message - is a unit of Data that’s transmitted
between a program and a Terminal
• The above type of program is called Message
Processing Programs (MPPs)
Regions in IMS
• MPP Region
– is where IMS schedules & executes Message Processing
Programs.
– The Number of MPP Regions determines the number of
MPPs that can be active at any one time.
– A program that occupies an MPP Region runs until it has
processed all of the input messages that IMS has received
for it. Then it ends, and the MPP region in which it was
running is freed and made available for another
Application Program.
• BMP (Batch Message Processing) Region
– A BMP program is much like MPP, except terminal
response is not required for each input Message, and
the Database Processing an input message requires
does not have to be done immediately.
– These are typically Batch Programs.
– The main Advantage is, it can access Data Bases
that are allocated to the IMS Control Region for use
by MPPs at the same time.
• Control Region
– The main function of this region is that, all terminal,
Database, and Logging Operations associated with
IMS-DC programs are performed through this
Region.
Module 2 - IMS-DC Processing

Programming Elements for DC Processing


– DL/I Calls for DC Operation
– PCB mask for DC Operation
– Message Handling.
• DL/I Calls for DC Operation
Ex: CALL ‘CBLTDLI’ USING DLI-GU
IO-PCB-MASK
INPUT-MESSAGE-SEG

– Just as in DB call, the first argument is the


Function code value for the operation to be
performed. The call functions basically used
are get-unique (GU), get-next (GN) & insert
(ISRT).
– Issue a GU call to retrieve the first segment
of an Input Message. GN is issued to retrieve
the subsequent Messages.
– One ISRT call is issued for each segment, to
send an Output Message.
• PCB Mask for DC Operation
– A DC call must specify a Linkage Section
PCB Mask, which is a special one that’s just
for Message Processing. It’s called I/O PCB.
– To provide addressability to this PCB, the
program must name its Linkage section mask
definition on the ENTRY statement at the
beginning of the Procedure Division.
• I/O PCB Mask
01 IO-PCB-MASK.
05 IO-PCB-LOGICAL-TERMINAL PIC X(8).
05 FILLER PIC X(2).
05 IO-PCB-STATUS-CODE PIC X(2).
05 IO-PCB-DATE PIC S9(7) COMP-3
05 IO-PCB-TIME PIC S9(6)V9 COMP-3
05 IO-PCB-MSG-SEGMENT-NUMBER PIC S9(5) COMP.
05 IO-PCB-MOD-NAME PIC X(8).
05 IO-PCB-USER-ID PIC X(8).
• Message Handling
– When GU or GN calls been issued to retrieve
an Input Message Segment, DL/I places the
Message Segment data in the I/O Area the
call names.
– When ISRT call is issued to send an output
Message Segment, DL/I gets the Data from
the I/O Area the call names.
• Retrieving An Input Message –
– Application Program issues either a Single
‘GU’ call or a ‘GU’ call followed by one or
more ‘GN’ calls.
– To retrieve retrieve single segment input
message, One ‘GU’ call need to be issued.
When the Program gets ‘QC’ status code
( Instead of Blanks), it should be noted that
there is end of messages in the Queue.
– To retrieve Multiple segment input
Messages, need to issue ‘GU’ call first this
retrieves the first Segment. Then, to retrieve
subsequent message segments for that
Message, it issues ‘GN’ calls repeatedly until
‘QD’ status code is encountered.
• To Send An Output Message –
– Issue ISRT calls that specify the I/O PCB.
– The Program issues a separate ISRT calls for
each segment for Multiple Segments to be
written.
– I/O Area to be build before you issue this call
• Input Message I/O Area Format

LL Data

ZZ
•LL – Length of Entire Segment Usage: S9(3) Comp
•ZZ – IMS Reserved Data Usage: S9(3) Comp
• Output Message I/O Area Format

LL Data

Z1 Z2
•LL – Length of Entire Segment Usage: S9(3) Comp
•Z1 & Z2 – IMS Reserved Data Usage: X(2)
Module –3, MFS Facilities

• Message Format Services (MFS)


– MFS, is an IMS feature that lets you used
Formatted Display Screens.
– MFS Modules reside in the IMR Control
Region, and they are invoked between IMS
Communication Control Module and its
Queue Manager.
• MFS Control Blocks :
– To process a Transaction, MFS uses 4
Control Blocks.
Input Messa
ge
M essage Device Input Mesg Input Recv by Pro
n p u t i n al gram
I erm Format (DIF) Descriptor
b y T Applicati
Sent
(MID) on
Program
Terminal
Mesg Output
Out Device Output
put Descriptor
Rec
v by
Mes
sage Format (DOF) M essage
ut
Term (MOD) Outp ro gram
inal by P
Sent
– For an Input Message, MFS uses a block
called a Device Input Format (DIF) to
interpret data as it’s received from a
Terminal.
– It uses second Block called Message Input
Descriptor (MID), to determine how that
input Data should be formatted for
presentation to the Application Program.
– For an Output Message, MFS uses Similar
blocks, A Message Output Descriptor
(MOD) is used to interpret Data Received
from the Application Program.
– A Device Output Format (DOF), is used to
determine how that Data should be formatted
for Transmission to the Terminal.
– A group of Related all these four Control
Blocks are called FORMAT SET.
• Format Set
– Creating a Format Set
– MFS Language Utility is used to Translate
the Format Sets to the Control Blocks.
– To run the Application
/Format <MOD name>
Module – 4, Advanced IMS DC Topics

• Paging
– The Facility that lets Messages to be Broken
down into Components for display, for
Processing or for both purpose.
– Advantage of Paging is that it facilitates to
create Long & Complex output Messages.
– There are Two kinds of Paging
• Physical Paging
• Logical Paging
• Alternate Destination Concepts :
– The application Program that’s processing a
Single Input Message can send multiple
Output Message to Multiple Destinations.
– ISRT call is issued but only difference is that
the call specifies Alternate PCB instead of
I/O PCB.
– Alternate PCB (ALTPCB), which are
specified in the programs PSBGEN job,
name the other terminals or transactions to
which the program can send Messages.

Input Message

Terminal Output Message


(IOPCB) Application
Data
Program
es s age Base
ut put M
O B)
P C
Printer (A L T
• Batch Message Processing Application:
– A BMP program, is a combination of an MPP
and a Batch Program.
– A BMP program runs in a dependant Region
under the control of IMS
– A BMP program is scheduled through JCL,
it’s not automatically Scheduled by IMS.
• Conversational Application
– There are three ways to maintain Data
between Terminal Interaction.
• Store Data in the Terminal Screen.
• Store Data in the Databases
• Store Data in the IMS provided Scratch Pad
Area.
• Advantages & Disadvantages of these
Techniques.
– The First technique, is suitable only if the
Data is Simple & Non-Critical.
– The Second Technique, makes your Program
more complicated and less efficient.
– The Last Technique, is to use a special area
IMS provides just for that Purpose : The
Scratch Pad Area (SPA).
• Scratch Pad Area (SPA)
– A conversational Program must use a SPA.
– A Unique SPA is associated with each
terminal that’s running a conversational
transaction.
• Using SPA:
– Define I/O Area for SPA :
01 SPA-IO-AREA.
05 SPA-LL PIC S9(4) COMP.
05 SPA-ZZ PIC S9(4) COMP.
05 SPA-CI PIC S9(4) COMP.
05 SPA-TRAN-CODE PIC X(8).
05 SPA-USER-DATA PIC X(---).

– The area is much similar to the Message


Segment
– In Addition to LL & ZZ fields, the SPA
contains a Third binary halfword CI
(Conversational Identifier) which IMS uses
to keep track of SPA.
• IMS Calls in Conversational Programs :
– In Conversational Programs, SPA should be
retrieved first before retrieving Message
Segments. This is done by issuing a ‘GU’
call against I/O PCB.
CALL ‘CBLTDLI’ USING DLI-GU
IO-PCB-MASK
SPA-IO-AREA.
– To save Data in the SPA, an ISRT call is
issued against I/O PCB.
CALL ‘CBLTDLI’ USING DLI-ISRT
IO-PCB-MASK
SPA-IO-AREA

– You must not send an output Message


Segment before you’re saved the SPA.
– At the start of conversation, the SPA is set to
Binary Zeros.
• Program Switching :
– Switching from on Conversational Program
to Another requires that both the SPA &
Message to be processed by the second
program be transferred.
– There are two kinds of Program-to-Program
Message switches
• Immediate Program Switching.
• Deferred Program Switching.
• Immediate Program Switching :
Application
ssa ge Program - 1
u t Me
In p
Switch

SPA
Message
Terminal Segment
Out
pu tM
essa Application
ge
Program - 2
– The Program that receives the input Message
is not the same one that responds to the
Terminal.
– The First Program passes in SPA and other
necessary data to the second Program, which
does additional processing and respond to the
originating terminal.
• Deferred Program Switching :
g e 1 Application
essa
u t M 1 Program - 1
Inp sa ge
M es
t p ut
Ou

SPA
Terminal
Inpu
t Mes
sa ge 2
Out
pu tM Application
essa Program - 2
ge 2
– A single Conversation involves two different
Application Programs, one for each of two
terminal Interactions.
– The data stored in SPA is passed from the
first program to the Second.
– The second program isn’t invoked until the
user sends the next input message
– This technique can impose less overhead on
the IMS system & can result in faster
response.
Module-5, Error Handling in IMS.

• Logging:
– Records all Database Updates, all Message
queued and all program scheduled.
– These Information can be used to restore the
system if a failure occurs.
• Recovery:
– IMS provides extensive facilities for
Recoveries in the event of failure
– If an Application Program Abends, IMS
automatically reverse or Rollback the
changes it has made to the Databases and
Message Queues.
• Checkpointing:
– The checkpoints are taken automatically with
each transaction a program processes. (This is
called Single Mode Processing.)
– In Multiple Mode Processing, the only
automatic checkpoint is at the End of the
Program. However, the program can force a
checkpoint by issuing CHKP call, which causes
IMS to write a Checkpoint Record to the Log.
– The Checkpoint Call Syntax:

CALL ‘CBLTDLI’ USING DLI-CHKP


IO-PCB-MASK
INPUT-MESG-IO-AREA.
• Batch Terminal Simulator (BTS)
– It is an IMS-DC Program Development Tool.
– This tool lets you run DC Applications using
real DL/I Databases, MFS Format sets, and
IMS Modules.
– Apart from running the Application, this
gives you lot of Information which could be
used for Debugging Purpose.
– Should be run from Batch Environment.

You might also like