Introduction IMS DC and MFS

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 103

IMS DC

March-09-2005 IMS DC Introduction & MFS Page : 1


Objectives
To provide an insight into the fundamentals
of IMS-DC.
Should be able to Code IMS DC programs
on Mainframe.

March-09-2005 IMS DC Introduction & MFS Page : 2


Prerequisite
Trained in
 TSO/ISPF with hands on sessions.
 IMS DB - Knowledge of DBD, PSB, PCB mask
& different DLI Calls are essential.
 XPEDITER

Has written and tested COBOL programs


using IMS DB.

March-09-2005 IMS DC Introduction & MFS Page : 3


Course Outline

M# Topic
1 Introduction to IMS DC
& MFS
2 PSB
3 IMS DC Programming

March-09-2005 IMS DC Introduction & MFS Page : 4


Module 1
IMS DC Introduction & MFS

March-09-2005 IMS DC Introduction & MFS Page : 5


References
IMS for COBOL Programmer by Steve
Eckolos.
MVS/JCL by Doug Lowe.
Sample IMS DC programs from Mainframe
installations.

March-09-2005 IMS DC Introduction & MFS Page : 6


Introduction

March-09-2005 IMS DC Introduction & MFS Page : 7


Transaction
Input Message
Output Message
Transaction code

March-09-2005 IMS DC Introduction & MFS Page : 8


Importance of optimizing memory usage
Too many users.
Too many programs.
Only limited Regions.
Faster execution of programs.

March-09-2005 IMS DC Introduction & MFS Page : 9


Interactive Programs
What is Online Processing ?
Differences between Batch & Online
Processing.
Online Program types:
Inquiry
Data Entry
Data update
Menu Programs

March-09-2005 IMS DC Introduction & MFS Page : 10


IMS Data Communication(DC) Basic

Input Message

Terminal IMS DC
Process
Program
Output
Database
Message

March-09-2005 IMS DC Introduction & MFS Page : 11


Batch Processing

Transaction file

DL/I Batch Process DL/I DB


Program

Report

March-09-2005 IMS DC Introduction & MFS Page : 12


MFS

March-09-2005 IMS DC Introduction & MFS Page : 13


What is a Message
Message is a unit of data that is transmitted
between a program and a terminal.The
primary inputs to and outputs from DC
programs are messages.

March-09-2005 IMS DC Introduction & MFS Page : 14


Message Format Services
MFS is an IMS feature that allows to use
Formatted Display Screens for data
communication programs.
MFS Modules reside in the IMS Control
Region, and they are invoked between IMS
Communication Control Module and its
Queue Manager.
MFS can reduce system resources and
application users.

March-09-2005 IMS DC Introduction & MFS Page : 15


The 3270 Information Display System

3270 display screen


Protection attribute
Intensity attribute
Shift attribute

March-09-2005 IMS DC Introduction & MFS Page : 16


MFS Control Blocks

Input message
Device Message as received by
Input message Input Maps to Input application
as sent by Format Descriptor program
terminal (DIF) (MID)

Application
program
Terminal

Device Message Output message


Output message Output Maps to Output as sent by
as received by Format Descriptor application
terminal (DOF) program
(MOD)

MFS blocks used to process a single transaction

March-09-2005 IMS DC Introduction & MFS Page : 17


MFS Control Blocks (Contd)
Device Input Format (DIF).
Message Input Descriptor (MID).
Device Output Format (DOF).
Message Output Descriptor (MOD).

March-09-2005 IMS DC Introduction & MFS Page : 18


DIF & DOF
Device Input Format (DIF) is used to
interpret
data as it’s received from a Terminal.
Device Output Format (DOF) is used to
determine how that Data should be
formatted for Transmission to the Terminal.

March-09-2005 IMS DC Introduction & MFS Page : 19


DIF & DOF(Contd)
e.g.
PRINT NOGEN
LFCSG1 FMT
DEV TYPE=(3270,2),FEAT=IGNORE,SYSMSG=SYSMSG
DIV TYPE=INOUT
LFCSG101 DPAGE CURSOR=((6,33))
DFLD 'G1-CSG1',POS=(1,2),ATTR=(NUM,PROT,HI)
OPMSG DFLD LTH=79,POS=(24,2),ATTR=(PROT,HI)
FMTEND
EJECT

March-09-2005 IMS DC Introduction & MFS Page : 20


MID
The Message Input Descriptor(MID) is used
to determine how input data should be
Formatted for presentation to the
Application Program.MID maps relevant
device fields(DFLDs) to the fields in the
input message area(MFLDs) that will be
retrieved in the application program.

March-09-2005 IMS DC Introduction & MFS Page : 21


MID(Contd)
e.g.
MIDCG101 MSG TYPE=INPUT,SOR=LFCSG1,NXT=MODCG101
SEG
MFLD (TRANCD,'LAG1 '),LTH=6
MFLD PFKEY,LTH=2,FILL=X'40‘
MSGEND
EJECT

March-09-2005 IMS DC Introduction & MFS Page : 22


Relevance of Transaction code in MID
Transaction code:
 IMS uses the values in the first eight bytes of an
input message to identify the message’s type. If
the first 8 characters name an application
program , then the message is a transaction
code.The first 8 bytes of a transaction are called
transaction code(no. of chars in Trancode may
vary from an installation to other).
 Transaction code will be the very first field in the
MID definition of MFS.It will be used by IMS to
invoke a program.

March-09-2005 IMS DC Introduction & MFS Page : 23


MOD
A Message Output Descriptor (MOD) is used
to interpret Data Received from the
Application Program. MOD maps the fields
from the Output message area(MFLDs) to
the respective device fields (DFLDs).

March-09-2005 IMS DC Introduction & MFS Page : 24


MOD (Contd)
e.g.
MODCG101 MSG TYPE=OUTPUT,SOR=(LFCSG1,IGNORE),NXT=MIDC11
SEG
MFLD (,SCA),LTH=2
MFLD IMSRGN,LTH=4
MFLD OPCODE,LTH=2
MFLD DTTIME,LTH=17

March-09-2005 IMS DC Introduction & MFS Page : 25


MID & MOD (Contd)
All MID fields need not be present in MOD.
All MOD fields need not be present in MID.
There might be fields present in both MID &
MOD.

March-09-2005 IMS DC Introduction & MFS Page : 26


Format Set
A group of related MIDs,MODs,DIFs and
DOFs is called a format set.
Format set:
Defines the way the screens will look on all
supported device types.
Defines the format of the input and output
messages the application program will receive
and send.
Specifies the relationships between data on the
screen and data in a message.

March-09-2005 IMS DC Introduction & MFS Page : 27


MFS Language Utility
MFS Language Utility is used to Translate the
Format Sets to the Control Blocks.
It makes sure that the specifications are
syntactically correct.
With MFS Language utility it is possible to
process the different groups of Format Set
separately and at different times.

March-09-2005 IMS DC Introduction & MFS Page : 28


Format of an MFS Control Statement

The control statement has the following format:


COLS
1-8 Label.
10 - 14 Operation.
16 - 71 Operand.
72 Continuation Char.

March-09-2005 IMS DC Introduction & MFS Page : 29


MFS Control Statement(Contd…)
USERID DFLD LTH=8,POS=(2,1),ATTR=(NUM,PROT,HI)
DFLD 'R X D R U G S P R O C E S S E D H I S TO’X ,
POS=(2,14),ATTR=(NUM,PROT,HI)

March-09-2005 IMS DC Introduction & MFS Page : 30


Define a Screen in Format Set
lf the program uses same device(3270) for
input and output then same set of control
statements can be used for Input and Output.
One Set of Control statements for both DIF &
DOF.
Device Format begins with FMT & ends with
FMTEND.

March-09-2005 IMS DC Introduction & MFS Page : 31


Screen in Format Set
FMT
DEV
DIV
DPAGE
DFLD
DFLD
DPAGE
FMTEND

March-09-2005 IMS DC Introduction & MFS Page : 32


Device Format Control Statement
DEV
DIV
FMT
DPAGE
DFLD
FMTEND

March-09-2005 IMS DC Introduction & MFS Page : 33


FMT
Device Format always begins with FMT
Statement.
Control statements end with a FMTEND
Statement.
FMT and FMTEND statement should have
appropriate label.
Label coded on FMT statement cannot be
more than six characters long.

March-09-2005 IMS DC Introduction & MFS Page : 34


FMT
INQDF FMT
DEV TYPE=(3270,2),FEAT=IGNORE,DSCA=X’OOAO’
DIV TYPE=INOUT
TRANINV DPAGE CURSOR=((1,2))
DFLD POS=(1,2),LTH=15
OUTTEXT DFLD POS=(3,2),LTH=702
FMTEND
INQO MSG TYPE=OUTPUT,SOR=(INQDF,IGNORE),NXT=INQI
SEG
MFLD OUTTEXT,LTH=702
MSGEND
INQI MSG TYPE=INPUT,SOR=(INQDF,IGNORE),NXT=INQO
SEG
MFLD TRANINV,LTH=15
MSGEND
END

March-09-2005 IMS DC Introduction & MFS Page : 35


DEV
TYPE: Specify the device models for
which device format blocks should
be created.
DSCA: To specify a default terminal action
that’s performed when an output
message is sent to a 3270 device.
 e.g. DSCA=X’00A0’ causes unprotected
fields on the screen to be erased before the
new data is written to it or output message is
displayed.

March-09-2005 IMS DC Introduction & MFS Page : 36


DEV
FEAT: Specifies that the DIF and DOF
generated for this DEV Statement will work
with the indicated 3270 terminal
type,regardless of any special features
installed in it.IGNORE is the value coded
for the FEAT parameter.

March-09-2005 IMS DC Introduction & MFS Page : 37


DEV (Contd)
SYSMSG: Names a device field in which
messages that come to the terminal from
IMS will be displayed.
DPAGE: Primary Function is to Handle
Multiple logical pages and Secondary
Function is Initial Cursor positioning &
Field Fill.

March-09-2005 IMS DC Introduction & MFS Page : 38


DEV (e.g.)
LFCSG1 FMT
DEV TYPE=(3270,2),FEAT=IGNORE

PFK=(PFKEY,1='01',2='02',3='03‘)
FMTEND
MIDCG101 MSG TYPE=INPUT,
SOR=LFCSG1,NXT=MODCG101
SEG
MFLD PFKTEXT,LTH=2
MSGEND

March-09-2005 IMS DC Introduction & MFS Page : 39


Program function Keys (Pfkeys)
PFK parameter specifies how MFS should
support program function keys.
First Part: Target input message field
Second Part: Keyword / positional format
Positional:
PFK=(PFKTEXT,‘01’,‘02’,,,,,,‘08’)

March-09-2005 IMS DC Introduction & MFS Page : 40


DFLD
Specifies where on the screen a field is
located & how large the field is.
Need to code a label only when the device
field it defines are to be related with an
input,output or both.
LTH : Not to be specified for a Literal in a
device field.

March-09-2005 IMS DC Introduction & MFS Page : 41


DFLD Control Statement
IMSRGN DFLD LTH=4,
POS=(1,10),
ATTR=(ALPHA,PROT,MOD)
ATTR=
ALPHA / NUM
NOPROT/PROT
NORM/NODISP/HI
NOMOD/MOD

March-09-2005 IMS DC Introduction & MFS Page : 42


Modified Data Tags
MDT tag indicates whether or not the data
in the field has been changed by the
terminal user since
the screen was sent to the device.
When a screen is displayed, MDT’s of field
is OFF.
MDT will be set to ON only for the fields that
which are modified by the terminal user.
MFS sends the fields with MDT on to the
input message.

March-09-2005 IMS DC Introduction & MFS Page : 43


MOD Attribute (Contd…)
There could be some fields which a terminal
user need not or may not edit, but still need
to be sent back to the application program.
This can be achieved by specifying
ATTR=(..,MOD,..) for the respective DFLD.
Specifying MOD attribute sets MDT on
forcibly for that field and hence it will be
carried back to application program.

March-09-2005 IMS DC Introduction & MFS Page : 44


Message Output Descriptor(MOD)
To get the terminal ready to run the application the
IMS command /FORMAT, followed by the name
of the MFS message output descriptor(MOD)
for the application is entered.
MFS selects the right device output format block to
format the screen for the program. The “right” DOF
is the one that corresponds to the MOD that is
specified and to your terminal type, which IMS
knows.
There can be several DOFs for a single MOD.

March-09-2005 IMS DC Introduction & MFS Page : 45


Define Messages in a Format Set
Code separate sets of control statements to define
a MID and a MOD.
Begin with a MSG & end with a MSGEND.
MOD: TYPE=OUTPUT
MID: TYPE=INPUT
Must code a label on the MSG statement.
Message Fields: MFLD
LTH=55 (LL & ZZ fields that are defined in the
segment I/O areas need not be included in the
message description in the format set).

March-09-2005 IMS DC Introduction & MFS Page : 46


Just, Fill, Attr parameter in MFLD Statement
JUST:This parameter specifies how data should be
positioned in a message field.(Default is Left
Justification).
 e.g. MFLD DD,LTH=2,JUST=R
FILL: This parameter specifies what pad character MFS
should use to complete a field when the data
that’s mapped into it doesn’t fill it.
e.g. FILL=C’0’ ; FILL=X’ ‘ ; FILL=NULL

ATTR = YES specifies that an application program


can dynamically change the attributes set in the
Device field.

March-09-2005 IMS DC Introduction & MFS Page : 47


Viewing the MFS Screen Layout
For many purposes we may need to view
the layouts for MFS screens. The following
slides explains how it is possible to do that
through changeman.
Step 1:Step 1
Start 'Change Man' and select option 1
(Build).

March-09-2005 IMS DC Introduction & MFS Page : 48


Viewing the MFS Screen Layout

March-09-2005 IMS DC Introduction & MFS Page : 49


Step 2
From the 'Build Options' menu, choose option L (Listing).

March-09-2005 IMS DC Introduction & MFS Page : 50


Step 3
Enter the name of the MFS screen in the 'Component Name'
field. Clear the name of the 'Package ID'. Press Enter.

March-09-2005 IMS DC Introduction & MFS Page : 51


Step 4
Select the name of the screen name using the letter S (Select).

March-09-2005 IMS DC Introduction & MFS Page : 52


Step 5
In the listing, search for the string
'<last 2 letters of program name>-<last 4
letters of the screen name>'

March-09-2005 IMS DC Introduction & MFS Page : 53


Step 6
First you may arrive at a location like the one shown below.
Repeat the search till you arrive at the screen layout.

March-09-2005 IMS DC Introduction & MFS Page : 54


Step 7
Once the screen layout is found, the whole screen can be
displayed using the F11 key

March-09-2005 IMS DC Introduction & MFS Page : 55


Page 8
There's your screen.

March-09-2005 IMS DC Introduction & MFS Page : 56


End of Module 1

March-09-2005 IMS DC Introduction & MFS Page : 57


Module 2
IMS DC - PSB

March-09-2005 IMS DC Introduction & MFS Page : 58


How DL/I define data bases
DL/I uses a set of control blocks to define a
data base’s structure. Application programs
can communicate with the database without
being aware of physical location of the data.
To accomplish this, DL/I uses two types of
control blocks:
Data Base Description(DBD) which describes
the complete structure of a data base.
Program Specification Block(PSB) which
specifies information on databases a program
accesses, and the associated PCBs.

March-09-2005 IMS DC Introduction & MFS Page : 59


Normal relationship between Application Pgm/PSB/PCB/DBD

PSB

PCB1 DBD 1 DB 1

Application
program

PCB2 DBD 2 DB 2

March-09-2005 IMS DC Introduction & MFS Page : 60


PSB
Although each data base has a single
physical structure that’s defined by a DBD,
the application programs that process it can
have different views of it.These views
specify the following information in the PSB:
 The databases a program can access.
 Different ‘sensitive’ segments (SENSEG) in
the database.
 Processing options available (PROCOPT)
Note:Although each application program can have its own
PSB,application programs that have similar data
base processing requirement share the same
PSB
March-09-2005 IMS DC Introduction & MFS Page : 61
PSB/PSBGEN
A PSB specifies the database segments an
application program can access and the
functions it can perform on the data, such as
read only, update, or delete. Because an
application program can access multiple
databases, PSBs are composed of one or
more program control blocks (PCBs). The
PSB describes the way a database is viewed
by your application program.

March-09-2005 IMS DC Introduction & MFS Page : 62


PSB/PSBGEN(Contd)
The data base administrator codes the
assembler language statements necessary to
define a PSB, then assembles and links
them, storing the resulting load module in a
partitioned data set (OS) or a core image
library(DOS).This process of generating a
PSB is called PSBGEN.

March-09-2005 IMS DC Introduction & MFS Page : 63


PSB (Contd)
PCB TYPE=TP,MODIFY=YES.
PCB TYPE=TP,NAME=LMQ01.
PCB TYPE=DB,DBDNAME=LDB37P,KEYLEN=200,PROCOPT=GD.
SENSEG NAME=SEGL3701,PARENT=0.
PCB TYPE=DB,DBDNAME=LDB37C,KEYLEN=200,PROCOPT=G.
SENSEG NAME=SEGL3701,PARENT=0.
PSBGEN PSBNAME=L009,LANG=COBOL,CMPAT=YES.
END.
Note: One naming constraint for PSBs of online
programs is that its name should be same as the
online program.(In the above mentioned example the
program should have the name L009 ).

March-09-2005 IMS DC Introduction & MFS Page : 64


Macros in PSBGEN
PCB
SENSEG
PSBGEN
Program Communication Block (PCB):
PCB : Describes the program’s view of the
database.
Defined during PSB Generation(PSBGEN).
PCBs within a PSB should correspond to the
PCB masks in the program ENTRY statement.

March-09-2005 IMS DC Introduction & MFS Page : 65


PCB (CONTD)
e.g.
ENTRY 'DLITCBL' USING TPPCB.
ALTPCB1.
ALTPCB2.
ALTPCB3.
CONT-DBPCB1.
CONT-DBPCB2.
DBPCB4.

Types of PCBs:
 IO PCB(TPPCB)
 ALTPCB
 DBPCB

March-09-2005 IMS DC Introduction & MFS Page : 66


PCB(Contd)
Input Output PCB.
It supports communication between a
program and a terminal.
IOPCB is not specified in the PSB. It is a
pre-generated by the IMS system(these type
of PCBs are called as GPCBs).

March-09-2005 IMS DC Introduction & MFS Page : 67


PCB(Contd)
CMPAT= parameter on PSBGEN macro
provides compatibility between BMP or MSG
and Batch-DL/I parameter lists. If
CMPAT=YES, the PSB is always treated as
if there were an I/O PCB, no matter how it is
used. If CMPAT=NO, the PSB has an I/O
PCB added only for BMP or MSG regions.
The default is NO.
IOPCB is the first PCB in the ENTRY
statement in a program.

March-09-2005 IMS DC Introduction & MFS Page : 68


ALTPCB
Specified in a program’s PSBGEN Job.
Names other terminals or application
programs to which the program can send
messages.
Different Types :
Modifiable Alternate PCB
Fixed Alternate PCB

March-09-2005 IMS DC Introduction & MFS Page : 69


ALTPCB(Contd)
Modifiable Alternate PCB: The application
program can change the terminal or program to
which associated output messages are sent.In the
program the PCB is coded as
e.g. PCB TYPE=TP,MODIFY=YES.

March-09-2005 IMS DC Introduction & MFS Page : 70


ALTPCB(Contd)
Fixed Alternate PCB:The application program
cannot change the terminal or program
associated with a Fixed Alternate PCB.Here
‘Modify’ parameter is not included in the code.
e.g. PCB TYPE=TP,NAME=LMQ01.

March-09-2005 IMS DC Introduction & MFS Page : 71


ALTPCB(example)
PCB TYPE=TP,MODIFY=YES.
PCB TYPE=TP,NAME=LMQ01.
PCB TYPE=TP,LTERM=LMSA3.
PCB TYPE=DB,DBDNAME=LDB37P,KEYLEN=200,PROCOPT=GD.
SENSEG NAME=SEGL3701,PARENT=0.
PCB TYPE=DB,DBDNAME=LDB37C,KEYLEN=200,PROCOPT=G.
SENSEG NAME=SEGL3701,PARENT=0.
PSBGEN PSBNAME=L009,LANG=COBOL,CMPAT=YES.
END.

March-09-2005 IMS DC Introduction & MFS Page : 72


DBPCB
DBPCB : Database Program
Communication Block
It describes an application program’s
interface to a DB.
One DBPCB is required for each of DB view
used by the application program.

March-09-2005 IMS DC Introduction & MFS Page : 73


DBPCB(example)
PCB TYPE=TP,MODIFY=YES.
PCB TYPE=TP,NAME=LMQ01.
PCB TYPE=DB,DBDNAME=LDB37P,KEYLEN=200,PROCOPT=GD.
SENSEG NAME=SEGL3701,PARENT=0.
PCB TYPE=DB,DBDNAME=LDB37C,KEYLEN=200,PROCOPT=G.
SENSEG NAME=SEGL3701,PARENT=0.
PSBGEN PSBNAME=L009,LANG=COBOL,CMPAT=YES.
END.

March-09-2005 IMS DC Introduction & MFS Page : 74


PCB Mask
PCB Mask:
The linkage section definition of a PCB
Addressability to the PCBs can be established by
listing the PCB masks on the ENTRY statement.
 e.g. ENTRY ‘DLITCBL’ USING TPPCB
ALTPCB
The status code stored in the PCB is used to
determine whether the call succeeded or failed.

March-09-2005 IMS DC Introduction & MFS Page : 75


SENSEG
Each PCB macro contains a
subordinate SENSEG macro.
SENSEG macro identifies the
segments in the data base to which the
application program is sensitive.
e.g. SENSEG NAME=SEGL3701,PARENT=0.

March-09-2005 IMS DC Introduction & MFS Page : 76


SENSEG(Contd)
PROCOPT parameter on the SENSEG
macro controls access to the data base more
selectively than is possible at the database
level.
e.g:
TYPE=DB,DBDNAME=LDB37P,KEYLEN=200,PROCOPT=GD

March-09-2005 IMS DC Introduction & MFS Page : 77


PSBGEN
PSBGEN is the last PSBGEN macro.
PSBGEN indicates there are no more
statements in the PSBGEN job.

March-09-2005 IMS DC Introduction & MFS Page : 78


Module 3
IMS DC Programming

March-09-2005 IMS DC Introduction & MFS Page : 79


IMS
DC handles information in the form of
messages that flow between terminals and
application programs.
Programs & DataBases, that will run under
the control of IMS, must be defined in the
IMS system definition.
This is done by IMS Administrators.

March-09-2005 IMS DC Introduction & MFS Page : 80


Types of IMS DC Application Programs
BMP: Batch Message Processing Program
Accesses message queues, DB accessed in
batch mode defined to Online systems.
MPP: Message Processing Program
Interactive, menu driven programs loaded
automatically by IMS when there is an input
message from terminal user.

March-09-2005 IMS DC Introduction & MFS Page : 81


How IMS uses MVS regions
IMS Control Region :
An IMS system uses several user regions, of
which one user region will have the IMS
control modules running in it. The main
function of this region is that, all terminal,
Database, and Logging Operations
associated with IMS-DC programs are
performed through this Region.

March-09-2005 IMS DC Introduction & MFS Page : 82


How IMS uses MVS regions(Contd)
Message Processing Program(MPP):
 Is where IMS schedules & executes Message
Processing Programs.
 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.

March-09-2005 IMS DC Introduction & MFS Page : 83


How IMS uses MVS regions (Contd)
Batch Message Processing region (BMP):
 A BMP program is much like MPP, except that the
terminal response is not required for each input
Message. The Database processing required by the
input message does not have to be done immediately.
IMS accumulates the transactions entered by the
terminal user into batch. Operator can explicitly start a
BMP program which processes the messages.
 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 in batch mode.

March-09-2005 IMS DC Introduction & MFS Page : 84


Terminals and security under IMS
Logical terminals
Master terminal
Security features
Security Maintenance Utility
Resource Access Control Facility
SIGN ON verification
 LTERM security

March-09-2005 IMS DC Introduction & MFS Page : 85


Logical Terminals
For application functions, IMS uses logical terminal
names (LTERM), rather than physical terminal
names or addresses.
Each LTERM is associated with one and only one
physical terminal. But the same terminal can be
associated to more than one LTERM name.
If IMS knows an LTERM name, it knows what
physical terminal is associated with it.
A physical terminal can be a Terminal, Printer,
Application program etc.
March-09-2005 IMS DC Introduction & MFS Page : 86
Master terminal
One logical terminal in the IMS network is
designated as the master terminal.
It is the operational center of the system.
This terminal manages other terminals in the
network, as well as messages and program
executions in dependent regions.

March-09-2005 IMS DC Introduction & MFS Page : 87


Message handling
The following are the call functions for basic
message processing applications:
Get-Unique (GU): To retrieve the first (and,
most often, only) segment of an input message
or a single segmented message you issue
GU calls.
e.g. CALL ‘CBLTDLI’ USING DLI-GU
IO-PCB
MSG-INPUT-AREA.

March-09-2005 IMS DC Introduction & MFS Page : 88


Message handling (Contd)
 Get-Next (GN): If an input message
contains multiple segments, you retrieve
subsequent ones with GN calls. If a GU
call is issued before retrieving all message
segments of current input message then
rest of the segments will be lost.
e.g. CALL ‘CBLTDLI’ USING DLI-GN
IO-PCB
MSG-INPUT-AREA.

March-09-2005 IMS DC Introduction & MFS Page : 89


Message handling (Contd)
 Insert (ISRT): To send an output
message an ISRT call is issued for each
segment in the message.
e.g. CALL ‘CBLTDLI’ USING DLI-ISRT
IO-PCB
MSG-OUTPUT-AREA.

March-09-2005 IMS DC Introduction & MFS Page : 90


Message handling (Contd)
 Single-segment messages: This type of
message can have only one segment occurrence.
It can be retrieved using a GU or GN call.
 Multiple-segment messages: This type of
message has more than one segment occurrence.
Only first segment of the input message will have
the transaction code. It can be retrieved by a GN or
GU call. Subsequent message segments can be
retrieved using a GN call. GU always retrieves new
input message.
March-09-2005 IMS DC Introduction & MFS Page : 91
Message handling (Contd)
 IMS places a Status Code in the STATUS-CODE
field of IO-PCB which can be checked for in the
application pgm to know the status of the call.
 A status Code of ‘QC’ for a GU or GN call
indicates the end of input messages to a program.
 A status Code of ‘QD’ for a GN call indicates the
end of message segments of the current
segmented message.

March-09-2005 IMS DC Introduction & MFS Page : 92


Message handling (Contd)
 Change(CHNG):To ensure that the alternate PCB
specifies the right destination the CHNG call is
issued.Application program has to move right
LTERM name into a variable which will be used as
last parameter on a DLI CHNG call.
e.g.MOVE ‘LMSG1’ TO LTERM-NAME
CALL ‘CBLTDLI’ USING DLI-CHNG
ALT-PCB1
LTERM-NAME.
Note: CHNG call can only set the destination,it should be
followed by ISRT call, which actually sends the message.
March-09-2005 IMS DC Introduction & MFS Page : 93
Routing output to alternate destinations
Alternate destination concepts
Alternate PCB
Modifiable alternate PCB
Fixed Alternate PCB

March-09-2005 IMS DC Introduction & MFS Page : 94


Alternate destination concepts
Data entry
Department Input
(Sacramento,CA Terminal Messag
) e
(IOPCB) Host system
Output
Message
(IOPCB)
Order entry
Accounting Output program
Printer
Department Message
(Los Angeles,CA) (ALTPCB)
Output
Message
(ALTPCB) Data bases
Output
Message
Warehouse (ALTPCB) Post orders
(Philadelphia,PA) Program
Printer

Data center
Palo
Alto,CA

An Order Entry application with three alternate destinations

March-09-2005 IMS DC Introduction & MFS Page : 95


How to use alternate PCBs
Code alternate PCB masks in the
application programs.
Route output to alternate destinations from
the application programs.
Route output to modifiable alternate
destinations from application programs.

March-09-2005 IMS DC Introduction & MFS Page : 96


Coding alternate PCB
An Alternate PCB format (PCB Mask) has
only three fields:
01 ALT-PCB-MASK.
05 ALT-PCB-DESTINATION PIC X(8).
05 FILLER PIC XX.
05 ALT-PCB-STATUS-CODE PIC XX.

March-09-2005 IMS DC Introduction & MFS Page : 97


Alternate PCB (Contd)
The first eight bytes long field contains
the destination(LTERM name or
transaction code) for output.
The next two byte field is a filler item
which contains data reserved for
IMS’s use.
The last field which is also a two byte field
contains the status code.

March-09-2005 IMS DC Introduction & MFS Page : 98


Routing output to alternate destinations
After the program has been set up with
appropriate alternate PCB mask and ENTRY
statement, specify the alternate PCB name
on ISRT call to send a message to an
alternate destination.
CALL ‘CBLTDLI’ USING DLI-ISRT
ALT-PCB-MASK
OUTPUT-MESSAGE-IO-AREA.

This technique uses fixed or modifiable alternate


PCBs to route messages.

March-09-2005 IMS DC Introduction & MFS Page : 99


Routing output to alternate
destinations(Contd)
The ISRT call is the same as for Fixed or
Modifiable alternate PCB . But, in case of Modifiable
Alternate PCB ,before ISRT call is issued pgm has
to set right destination.This can be done by issuing
a CHNG call.
CALL ‘CBLTDLI’ USING DLI-CHNG
ALT-PCB-NAME
WS-DESTINATION-NAME.
CALL ‘CBLTDLI’ USING DLI-ISRT
ALT-PCB-NAME
MSG-IO-AREA.
March-09-2005 IMS DC Introduction & MFS Page : 100
How to develop BMP application
BMP program concepts
 BMP program runs in one of the ‘dependent’
regions under IMS Control Region.
 BMP program can access online data bases
and can send and receive messages through
the IMS message queues.
 BMP program is scheduled through JCL.
 BMP programs can access MVS data sets

March-09-2005 IMS DC Introduction & MFS Page : 101


JCL for running a BMP application
//L00656 EXEC PGM=DFSRRC00,COND=(0,NE),
// PARM=(BMP,L00656,L00656,,,N00000,,0,&CKPTID,,,,,IMSS)
//*
//IMS DD DSN=&PSB..OL.PSBLIB,DISP=SHR
// DD DSN=&DBD..DBDLIB,DISP=SHR
//IMSLOGR DD &RESTART.DSN=IMSX.RLDSP.DYYJJJ.TXXXXXXX.VXX,
// UNIT=&UNITCT,DISP=OLD,VOL=SER=&TAPEIN1

Note:The first parameter in the EXEC passed to IMS region


controller pgm DFSRRC00 should be BMP. No need of
specifying database datasets instead we specify the IMS
region,IMSS in this case.

March-09-2005 IMS DC Introduction & MFS Page : 102


Thank You

March-09-2005 IMS DC Introduction & MFS Page : 103

You might also like