Introduction IMS DC and MFS
Introduction IMS DC and MFS
Introduction IMS DC and MFS
Version No:1.0a Date of Release: July 04 2022 Author:Anish Thomas, Vijay Reddy
March-09-2005
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
Page : 2
Prerequisite
Trained in
TSO/ISPF with hands on sessions. IMS DB - Knowledge of DBD, PSB, PCB mask
XPEDITER
March-09-2005
Page : 3
Course Outline
March-09-2005
Page : 4
March-09-2005
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
Page : 6
Introduction
March-09-2005
Page : 7
Transaction
Input Message Output Message Transaction code
March-09-2005
Page : 8
March-09-2005
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
Page : 10
Input Message
Terminal
Output Message
IMS DC Program
Process
Database
March-09-2005
Page : 11
Batch Processing
Transaction file
Process
DL/I DB
March-09-2005
Page : 12
MFS
March-09-2005
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
Page : 14
March-09-2005
Page : 16
Maps to
Maps to
March-09-2005
Page : 18
March-09-2005
Page : 19
DFLD OPMSG
March-09-2005
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
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
Page : 22
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
Page : 24
MOD (Contd)
e.g.
MODCG101 MSG SEG MFLD MFLD MFLD MFLD TYPE=OUTPUT,SOR=(LFCSG1,IGNORE),NXT=MIDC11 (,SCA),LTH=2 IMSRGN,LTH=4 OPCODE,LTH=2 DTTIME,LTH=17
March-09-2005
Page : 25
March-09-2005
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
March-09-2005
Page : 28
March-09-2005
Page : 29
March-09-2005
Page : 30
March-09-2005
Page : 31
March-09-2005
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
Page : 34
FMT
INQDF FMT DEV DIV DFLD DFLD FMTEND MSG SEG MFLD MSGEND MSG SEG MFLD MSGEND END TRANINV OUTTEXT INQO TYPE=(3270,2),FEAT=IGNORE,DSCA=XOOAO TYPE=INOUT DPAGE CURSOR=((1,2)) POS=(1,2),LTH=15 POS=(3,2),LTH=702 TYPE=OUTPUT,SOR=(INQDF,IGNORE),NXT=INQI OUTTEXT,LTH=702 TYPE=INPUT,SOR=(INQDF,IGNORE),NXT=INQO TRANINV,LTH=15
INQI
March-09-2005
Page : 35
DEV
TYPE: Specify the device models for which device format blocks should be created. DSCA: To specify a default terminal action thats performed when an output message is sent to a 3270 device.
e.g. DSCA=X00A0 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
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
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
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,
March-09-2005
Page : 39
March-09-2005
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
Page : 41
March-09-2005
Page : 42
March-09-2005
Page : 44
e.g. FILL=C0 ; FILL=X ; FILL=NULL ATTR = YES specifies that an application program
can dynamically change the attributes set in the Device field.
March-09-2005
Page : 47
March-09-2005
Page : 48
March-09-2005
Page : 49
Step 2
From the 'Build Options' menu, choose option L (Listing).
March-09-2005
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
Page : 51
Step 4
Select the name of the screen name using the letter S (Select).
March-09-2005
Page : 52
In the listing, search for the string '<last 2 letters of program name>-<last 4 letters of the screen name>'
Step 5
March-09-2005
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
Page : 54
Step 7
Once the screen layout is found, the whole screen can be displayed using the F11 key
March-09-2005
Page : 55
Page 8
There's your screen.
March-09-2005
Page : 56
End of Module 1
March-09-2005
Page : 57
March-09-2005
Page : 58
PSB
DBD 1
DB 1
DBD 2
DB 2
March-09-2005
Page : 60
PSB
Although each data base has a single physical structure thats 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
Page : 63
PSB (Contd)
PCB PCB PCB SENSEG PCB SENSEG PSBGEN END. TYPE=TP,MODIFY=YES. TYPE=TP,NAME=LMQ01. TYPE=DB,DBDNAME=LDB37P,KEYLEN=200,PROCOPT=GD. NAME=SEGL3701,PARENT=0. TYPE=DB,DBDNAME=LDB37C,KEYLEN=200,PROCOPT=G. NAME=SEGL3701,PARENT=0. PSBNAME=L009,LANG=COBOL,CMPAT=YES.
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 programs 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
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 programs 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
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
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
Page : 71
ALTPCB(example)
PCB TYPE=TP,MODIFY=YES.
PCB PCB
PCB SENSEG PCB SENSEG PSBGEN END.
TYPE=TP,NAME=LMQ01. TYPE=TP,LTERM=LMSA3.
TYPE=DB,DBDNAME=LDB37P,KEYLEN=200,PROCOPT=GD. NAME=SEGL3701,PARENT=0. TYPE=DB,DBDNAME=LDB37C,KEYLEN=200,PROCOPT=G. NAME=SEGL3701,PARENT=0. PSBNAME=L009,LANG=COBOL,CMPAT=YES.
March-09-2005
Page : 72
DBPCB
DBPCB : Database Program Communication Block It describes an application programs interface to a DB. One DBPCB is required for each of DB view used by the application program.
March-09-2005
Page : 73
DBPCB(example)
PCB PCB PCB SENSEG PCB SENSEG PSBGEN END. TYPE=TP,MODIFY=YES. TYPE=TP,NAME=LMQ01. TYPE=DB,DBDNAME=LDB37P,KEYLEN=200,PROCOPT=GD. NAME=SEGL3701,PARENT=0. TYPE=DB,DBDNAME=LDB37C,KEYLEN=200,PROCOPT=G. NAME=SEGL3701,PARENT=0. PSBNAME=L009,LANG=COBOL,CMPAT=YES.
March-09-2005
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
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
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
Page : 77
PSBGEN
PSBGEN is the last PSBGEN macro. PSBGEN indicates there are no more statements in the PSBGEN job.
March-09-2005
Page : 78
March-09-2005
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
Page : 80
March-09-2005
Page : 81
March-09-2005
Page : 82
March-09-2005
Page : 83
March-09-2005
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
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
Page : 88
March-09-2005
Page : 89
March-09-2005
Page : 90
March-09-2005
Page : 92
March-09-2005
Page : 94
Data bases
Warehouse (Philadelphia,PA)
March-09-2005
Page : 96
March-09-2005
Page : 97
March-09-2005
March-09-2005
Page : 101
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
Page : 102
THANK YOU
March-09-2005
Page : 103