Top Banner
March-09-2005 IMS DC Introduction & MFS Page : 1 IMS DC Version No:1.0a Date of Release: July 04 2022 Author:Anish Thomas, Vijay Reddy
103
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction IMS DC and MFS

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

IMS DC

Version No:1.0a

Date of Release: July 04 2022

Author:Anish Thomas,

Vijay Reddy

Page 2: Introduction IMS DC and MFS

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

Objectives

To provide an insight into the fundamentals of IMS-DC.

Should be able to Code IMS DC programs on Mainframe.

Page 3: Introduction IMS DC and MFS

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

Prerequisite

Trained inTSO/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.

Page 4: Introduction IMS DC and MFS

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

Course Outline

M# Topic 1 Introduction to IMS DC

& MFS 2 PSB 3 IMS DC Programming

Page 5: Introduction IMS DC and MFS

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

Module 1 IMS DC Introduction & MFS

Page 6: Introduction IMS DC and MFS

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

References

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

Page 7: Introduction IMS DC and MFS

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

Introduction

Page 8: Introduction IMS DC and MFS

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

Transaction

Input Message

Output Message

Transaction code

Page 9: Introduction IMS DC and MFS

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

Importance of optimizing memory usage

Too many users.

Too many programs.

Only limited Regions.

Faster execution of programs.

Page 10: Introduction IMS DC and MFS

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

Interactive Programs

What is Online Processing ?Differences between Batch & Online

Processing.

Online Program types:InquiryData EntryData updateMenu Programs

Page 11: Introduction IMS DC and MFS

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

IMS Data Communication(DC) Basic

Database

Terminal IMS DCProgram

Input Message

Output Message

Process

Page 12: Introduction IMS DC and MFS

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

Batch Processing

Transaction file

DL/I Batch

Program

Report

DL/I DBProcess

Page 13: Introduction IMS DC and MFS

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

MFS

Page 14: Introduction IMS DC and MFS

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

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.

Page 15: Introduction IMS DC and MFS

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

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.

Page 16: Introduction IMS DC and MFS

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

The 3270 Information Display System

3270 display screen

Protection attribute

Intensity attribute

Shift attribute

Page 17: Introduction IMS DC and MFS

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

MFS Control Blocks

Device InputFormat(DIF)

Device OutputFormat(DOF)

MessageInputDescriptor(MID)

MessageOutputDescriptor(MOD)

Maps to

Maps to

Terminal

Application program

Input message as sent by terminal

Output message as received by terminal

Input message as received by application program

Output message as sent by application program

MFS blocks used to process a single transaction

Page 18: Introduction IMS DC and MFS

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

MFS Control Blocks (Contd)

Device Input Format (DIF).

Message Input Descriptor (MID).

Device Output Format (DOF).

Message Output Descriptor (MOD).

Page 19: Introduction IMS DC and MFS

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

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.

Page 20: Introduction IMS DC and MFS

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

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

Page 21: Introduction IMS DC and MFS

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

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.

Page 22: Introduction IMS DC and MFS

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

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

Page 23: Introduction IMS DC and MFS

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

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.

Page 24: Introduction IMS DC and MFS

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

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).

Page 25: Introduction IMS DC and MFS

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

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

Page 26: Introduction IMS DC and MFS

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

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.

Page 27: Introduction IMS DC and MFS

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

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.

Page 28: Introduction IMS DC and MFS

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

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.

Page 29: Introduction IMS DC and MFS

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

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.

Page 30: Introduction IMS DC and MFS

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

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)

Page 31: Introduction IMS DC and MFS

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

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.

Page 32: Introduction IMS DC and MFS

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

Screen in Format Set

FMTDEV

DIVDPAGE

DFLDDFLD

DPAGE FMTEND

Page 33: Introduction IMS DC and MFS

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

Device Format Control Statement

DEV

DIV

FMT

DPAGE

DFLD

FMTEND

Page 34: Introduction IMS DC and MFS

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

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.

Page 35: Introduction IMS DC and MFS

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

FMTINQDF 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=702FMTEND

INQO MSG TYPE=OUTPUT,SOR=(INQDF,IGNORE),NXT=INQISEGMFLD OUTTEXT,LTH=702MSGEND

INQI MSG TYPE=INPUT,SOR=(INQDF,IGNORE),NXT=INQOSEGMFLD TRANINV,LTH=15MSGENDEND

Page 36: Introduction IMS DC and MFS

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

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.

Page 37: Introduction IMS DC and MFS

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

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 featuresinstalled in it.IGNORE is the value coded for the FEAT parameter.

Page 38: Introduction IMS DC and MFS

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

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.

Page 39: Introduction IMS DC and MFS

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

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

Page 40: Introduction IMS DC and MFS

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

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’)

Page 41: Introduction IMS DC and MFS

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

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.

Page 42: Introduction IMS DC and MFS

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

DFLD Control Statement

IMSRGN DFLD LTH=4,

POS=(1,10),

ATTR=(ALPHA,PROT,MOD)

ATTR=

ALPHA / NUM

NOPROT/PROT

NORM/NODISP/HI

NOMOD/MOD

Page 43: Introduction IMS DC and MFS

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

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.

Page 44: Introduction IMS DC and MFS

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

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.

Page 45: Introduction IMS DC and MFS

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

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.

Page 46: Introduction IMS DC and MFS

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

Define Messages in a Format SetCode 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: MFLDLTH=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).

Page 47: Introduction IMS DC and MFS

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

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.

Page 48: Introduction IMS DC and MFS

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

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).

Page 49: Introduction IMS DC and MFS

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

Viewing the MFS Screen Layout

Page 50: Introduction IMS DC and MFS

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

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

Page 51: Introduction IMS DC and MFS

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

Step 3Enter the name of the MFS screen in the 'Component Name'

field. Clear the name of the 'Package ID'. Press Enter.

Page 52: Introduction IMS DC and MFS

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

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

Page 53: Introduction IMS DC and MFS

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

Step 5In the listing, search for the string

'<last 2 letters of program name>-<last 4 letters of the screen name>'

Page 54: Introduction IMS DC and MFS

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

Step 6First you may arrive at a location like the one shown below.

Repeat the search till you arrive at the screen layout.

Page 55: Introduction IMS DC and MFS

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

Step 7Once the screen layout is found, the whole screen can be

displayed using the F11 key

Page 56: Introduction IMS DC and MFS

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

Page 8There's your screen.

Page 57: Introduction IMS DC and MFS

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

End of Module 1

Page 58: Introduction IMS DC and MFS

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

Module 2IMS DC - PSB

Page 59: Introduction IMS DC and MFS

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

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.

Page 60: Introduction IMS DC and MFS

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

Normal relationship between Application Pgm/PSB/PCB/DBD

Application

program

PSB

PCB1

PCB2

DBD 1

DBD 2

DB 1

DB 2

Page 61: Introduction IMS DC and MFS

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

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

Page 62: Introduction IMS DC and MFS

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

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.

Page 63: Introduction IMS DC and MFS

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

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.

Page 64: Introduction IMS DC and MFS

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

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 ).

Page 65: Introduction IMS DC and MFS

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

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.

Page 66: Introduction IMS DC and MFS

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

PCB (CONTD)

e.g.ENTRY 'DLITCBL' USING TPPCB.

ALTPCB1.

ALTPCB2.

ALTPCB3.

CONT-DBPCB1.

CONT-DBPCB2.

DBPCB4.

Types of PCBs: IO PCB(TPPCB)ALTPCBDBPCB

Page 67: Introduction IMS DC and MFS

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

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).

Page 68: Introduction IMS DC and MFS

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

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.

Page 69: Introduction IMS DC and MFS

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

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

Page 70: Introduction IMS DC and MFS

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

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.

Page 71: Introduction IMS DC and MFS

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

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.

Page 72: Introduction IMS DC and MFS

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

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.

Page 73: Introduction IMS DC and MFS

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

DBPCB

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

Page 74: Introduction IMS DC and MFS

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

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.

Page 75: Introduction IMS DC and MFS

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

PCB Mask

PCB Mask:The linkage section definition of a PCBAddressability 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.

Page 76: Introduction IMS DC and MFS

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

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.

Page 77: Introduction IMS DC and MFS

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

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

Page 78: Introduction IMS DC and MFS

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

PSBGEN

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

Page 79: Introduction IMS DC and MFS

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

Module 3IMS DC Programming

Page 80: Introduction IMS DC and MFS

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

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.

Page 81: Introduction IMS DC and MFS

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

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.

Page 82: Introduction IMS DC and MFS

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

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.

Page 83: Introduction IMS DC and MFS

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

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.

Page 84: Introduction IMS DC and MFS

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

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.

Page 85: Introduction IMS DC and MFS

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

Terminals and security under IMS

Logical terminals

Master terminal

Security featuresSecurity Maintenance Utility

Resource Access Control Facility

SIGN ON verification

LTERM security

Page 86: Introduction IMS DC and MFS

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

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.

Page 87: Introduction IMS DC and MFS

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

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.

Page 88: Introduction IMS DC and MFS

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

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-GUIO-PCB

MSG-INPUT-AREA.

Page 89: Introduction IMS DC and MFS

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

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.

Page 90: Introduction IMS DC and MFS

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

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.

Page 91: Introduction IMS DC and MFS

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

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.

Page 92: Introduction IMS DC and MFS

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

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.

Page 93: Introduction IMS DC and MFS

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

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-CHNGALT-PCB1LTERM-NAME.

Note: CHNG call can only set the destination,it should befollowed by ISRT call, which actually sends the message.

Page 94: Introduction IMS DC and MFS

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

Routing output to alternate destinations

Alternate destination concepts

Alternate PCB

Modifiable alternate PCB

Fixed Alternate PCB

Page 95: Introduction IMS DC and MFS

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

Alternate destination concepts

Order entry

program

An Order Entry application with three alternate destinations

Terminal

Printer

Printer

Post orders

Program

Data bases

Host system

OutputMessage(ALTPCB)

InputMessage(IOPCB)

OutputMessage(IOPCB)

OutputMessage(ALTPCB)

OutputMessage(ALTPCB)

Data entryDepartment(Sacramento,CA)

Accounting Department(Los Angeles,CA)

Warehouse(Philadelphia,PA)

Data centerPalo Alto,CA

Page 96: Introduction IMS DC and MFS

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

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.

Page 97: Introduction IMS DC and MFS

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

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.

Page 98: Introduction IMS DC and MFS

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

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.

Page 99: Introduction IMS DC and MFS

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

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.

Page 100: Introduction IMS DC and MFS

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

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.

Page 101: Introduction IMS DC and MFS

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

How to develop BMP application

BMP program conceptsBMP 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

Page 102: Introduction IMS DC and MFS

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

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.

Page 103: Introduction IMS DC and MFS

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

Thank You