IMS DC Self Study Complete Tutorial

srinipdn 24,748 views 94 slides Feb 09, 2016
Slide 1
Slide 1 of 94
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94

About This Presentation

What is IMS DC -This presentation comes with all relevant material for IMS DC programmers in mainframe environment.


Slide Content

IMS DC
IMS DC Slide: 1
Pre-Requisite: IMS DB knowledge

An Introduction
IMS DC Slide: 2

IMS:
Which is a Hierarchical DBMS, supplied by IBM & runs
on Mainframe Computers. It has 2 main components: Data Base (DB) Processing Data Communication (DC) Processing.
z
Note: DL/I DOS/VS does not support Data Communication Component.

Interactive Programs
IMS DC Slide: 3

M
ajor Kinds of Online Prog
rams that can be written:

I
nquiry Programs

D
ata Entry Programs

M
aintenance Programs
–M
e
n
u
P
r
o
g
r
a
m
s

COMPARISON BETWEEN ONLINE AND BATCH PROGRAMS
IMS DC Slide: 4
BATCH
O
NLINE
Pre-Determined Scheduling Intervals
Arbitrary Scheduling by Users
Necessary creation of Input Files
Processing of Data as it occurs
Lack of Access to current Data
Data up-to-date and current and available for Inquiry
Delay in Processing Erroneous Data
Immediate error correction
Databases cannot be shared with other updating programs
Database can be shared with other updating programs

Software Components of an
IMS
DC system
Data
bas
e
& datas
ets
C
o
mmun
ic
at
io
n
Con
t
rol
E
d
it
in
g
Mo
d
u
le
s
(MFS
)
Qu
eu
e Ma
nag
e
r
QPOOL
Mes
s
age Queue Over
f
low
datas
ets
VTAM
Ter
m
in
al
s
MVS a
ddress
Spac
e
VTAM
N
o
n VTAM
Te
r
m
in
al
s
MVS Address spa
c
e
IMS
/ V
S
con
t
r
o
l
re
gi
o
n
Lo
g
g
in
g
DLI
MVS add
r
e
ss
Sp
ace
MP
P region
MVS add
r
e
ss
Sp
ace
MP
P region
MVS add
r
e
ss
Sp
ace
MP
P region
MVS add
r
e
ss
Sp
ace
BM
P
r
e
g
ion
Log
g
in
g
data
sets
VT
A
M
T
e
r
m
in
als
IMS DC Slide: 5

IMS-DC OFFERS:
IMS DC Slide: 6
1. A way to improve customer a
nd internal service by providing
current and consistent information
2.
A way to interact with users with critical response times
3.
A way to distribute
processing
function to different locations
4.
A way to improve productivity for onlin
e
applications

Features of
IMS:
IMS DC Slide: 7
1. Manages IMS-DC Terminal
Network
2.
Routes Messages for variou
s
destination
s
3.
Scheduling of messages
4.
Manages resources allocated to IMS
5.
Provides restart, recovery facilities
6.
Interacts with Databases fo
r data retrieval and updation

ELEMENTS OF AN
IMS-DC ONLINE SYSTEM
¾
TERMINALS
¾
MESSAGES
¾
REGIONS
¾
PROGRAMS
¾
DATABASES
¾
IMS CONTROL BLOCKS
¾
IMS LOGS
IMS DC Slide: 8

IMS
S
TANDS BETWEEN THE TERMINAL AND THE APPLICATION PROGRAM
TERMINAL
DATABASE
IMS
INPUT MESSAGE
OUTPUT MESSAGE
INPUT MESSAGE
OUTPUT MESSAGE
PROCESS
IMS DC PROGRAM
IMS DC Slide: 9

IMS DC
IMS DC Slide: 10

D
C handles information in the form of me
ssages that flow between
remote terminals
and application programs.

P
rograms & Databases that will run under th
e control of IMS
must
be defined in the
IMS system definition.

T
wo main Categories of Resources:
Application Resources &
Data communication Resources

T
ypes of IMS DC Application Programs: BMP: Batch Message Processing, Scheduled by System operator MPP: Message Processing Program, scheduled by IMS

IMS DC Slide: 11

I
MS/VS forms a layer in between
the Terminal and the IMS-DC
programs, this helps in asynchronous mode of communication. This type of program is called
Message Processing Programs
(MPPs)

M
essage -
i
s a unit of Data that gets transmitted between a
program and a Terminal

P
rimary Inputs to and outputs from DC programs are messages.

F
or each Input message, DC program does predictable
processing against its databases and sends an output message that to User’s screen.

How IMS uses MVS regions
IMS DC Slide: 12
Regions in IMS
.
IMS/VS CONTROL
REGION
TER
M
IN
A
L
TER
M
IN
A
L
LOG DAT
ASETS
MP
P
REGION
MP
P
REGION MP
P
REGION
BMP REGION
DATABASE DATAS
E
T
S

Control Region
IMS DC Slide: 13

T
he main function of this region is that, all terminal,
Database, and Logging Operations associated with IMS-DC programs are performed through this Region.

MPP Region
IMS DC Slide: 14

M
PP Region

i
s where IMS schedules & executes Message
Processing Programs.

T
he 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.

Batch Message Program
IMS DC Slide: 15

B
MP (Batch Message Processing) Region

A
BMP program is much like MPP, except that the
terminal response is not required for each input Message. The Database Processing and input message requires does not have to be done immediately.

T
hese are typically Batch Programs.

T
he main Advantage is, it can access Data Bases
that are allocated to the
IMS Control Region, for use
by MPPs at the same time.

Terminals & Security under IMS
IMS DC Slide: 16

LTERM: For Application Functions, IMS uses logical terminal names rather than Physical names. Note: Within IMS, each LTERM name is associated with one and only one physical terminal. Ex: LDPAYR01

LTERM names are limited to 8 chars

M
aster Terminal

Terminals & Security under IMS
IMS DC Slide: 17

S
MU Security Maintenance Utility
RACF Resource Allocation & Control Facility

T
ransaction Security

S
IGN ON verification

LTERM security

How IMS Manages Input messages
IMS DC Slide: 18

T
hree kinds of IMS input messages:
a. Transactions b. Terminal to Terminal message c. IMS commands

I
MS uses first 8 bytes of an input message to identify the
message’s type.

H
ow IMS handles the three kinds of Input messages ???

I
nput message Editing

Input Message Editing
IMS DC Slide: 19

T
wo types of common Editing : IMS basic edit: Remove communication control
characters from input message and add them to output messages.
Message Format Service edit: Provides more
extensive editing functions.
MFS builds the input message that the application
program will receive. Part of building that message, it can insert the eight character transaction code at the beginning of the message.

How IMS supports an Application Program
IMS DC Slide: 20
After editing, IMS has to store the transaction temporarily. Queue manager stores the transactions in the message queue,
QPOOL.
If multiple transaction types are queued but too few dependent
regions are available for all
of them, IM
S makes scheduling
decisions.

IMS DC & CICS
IMS DC Slide: 21

M
any users are running an application, the IMS system funnels
all of their messages through one program.

C
ICS treats each user separately, it treats each terminal user
separately.

M
any users are entering data of the same program, all the
messages they enter are routed
to same application program by
IMS. IMS Keeps track of wher
e each message came from and
where each output message should go.

IMS DC Slide: 22
IMS-DC Processing
Programming Elements for IMS-DC Processing

D
L/I Calls for DC Operation

P
CB mask for DC Operation

M
essage Handling.

DL/I calls for DC operations
IMS DC Slide: 23

B
asic unit of I/O for data communication DL/I call is segment

M
ost messages consist of just one segment occurrence, some
may contain multiple segments.

M
essage segments are not arranged hierarchically, they just
represent parts of a message.
•A Data Base Call •CALL ‘CBLTDLI’ USING
DLI-GU DB-PCB-MASK RSEGMENT INV-SSA.
•A Data communication Call •CALL ‘CBLTDLI’ USING
DLI-GU IO-PCB-MASK RSEGMENT.

DL/I calls for DC Operation
IMS DC Slide: 24

C
ALL ‘CBLTDLI’ USING DLI-GU
IO-PCB-MASK INPUT-MESSAGE-SEG.

F
irst argument is the Function Code

GU: Issue a GU call to retrieve the first segment of an Input
Message.

G
N
i
s issued to retrieve the subsequent Messages.

I
SRT
c
all is issued for each segment, to send an Output
Message.

PCB Mask for DC operation
IMS DC Slide: 25

A
DC call must specify a Linka
ge Section PCB Mask, which is
a special one that’s just for Message Processing. It’s called I/O PCB.

T
o provide address 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 must be the first PCB listed on the ENTRY statement.

F
ormat of a I/O PCB is different from a data base PCB’s format.

Cobol Code for an I/O PCB mask.
IMS DC Slide: 26

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
P
IC S9(7) COMP-3
05 IO-PCB-TIME
P
IC S9(6)V9 COMP-3
05 IO-PCB-MSG-SEGMENT-NUMBER PIC S9(5) COMP. 05 IO-PCB-MOD-NAME
P
IC X(8).
05 IO-PCB-USER-ID
PIC X(8).

Message Handling
IMS DC Slide: 27

W
hen GU or GN calls been issued to retrieve an
Input Message Segment, DL/I places the Message Segment data in the specified I/O Area.

W
hen ISRT call is issued to send an output Message
Segment, DL/I gets the Data from the specified I/O Area.

Retrieving an Input Message
IMS DC Slide: 28

A
pplication Program issues either a Single ‘GU’ call or a ‘GU’
call followed by one or more ‘GN’ calls.

T
o 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 No messages in the Queue.

T
o retrieve Multiple segment input Messages, need to
issue ‘GU’ call first to retrieve the first Segment. Then, to retrieve subsequent message segments for that Message, it issues ‘GN’ ca
lls repeatedly until ‘QD’
status code is encountered.

Send an Output Message
IMS DC Slide: 29

I
ssue ISRT calls that specify the I/O PCB.

T
he 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
IMS DC Slide: 30
ZZ
LL
Data
•LL –
L
ength of Entire Segment Usage: S9(3) Comp
•ZZ –
I
MS Reserved Data Usage: S9(3) Comp

I
nput Message I/O Area Format

Output Message I/O Area Format
Z1
LL
Data
•LL –
L
ength of Entire Segment Usage: S9(3) Comp
•Z1 & Z2 –
I
MS Reserved Data Usage: X(2)
Z2
IMS DC Slide: 31

COBOL PR
OGRAM -
IDENTI
FICATION DIVISION.
PROGRAM-ID. PGM01. ENVIRONMENT DIVISION. DATA DIVISION. W
O
RKING-STORAGE SEC
T
I
ON.
01 SW
I
T
CHES.
05 E
ND-OF-MESSAGES-SW
PIC
X
VALUE 'N'.
88 END-OF-MESSAGES VALUE 'Y'.
01 INP
U
T-MESSA
GE-IO-AREA.
05 IN
-LL
P
IC
S9
(3) COM
P
.
05 IN
-ZZ PIC
S
9(3) COMP.
05 IN
-TRAN-CODE
PIC
X
(8).
05 IN
-INVN
O PIC
X
(6).
01 O-TEMP
P
IC
X(2000).
01 OUTPUT-MESSAGE-IO-AREA.
05 OP-LL
P
IC S9(3
) COM
P
-3 VALUE +14C.
05 OP-ZZ PIC
S
9(3) COMP-3 VALUE ZERO.
05 OP-INVNO PIC
X
(6).
05 OP-STAX PIC
9
(4).
IMS DC Slide: 32

01
DLI-FUNCTIONS.
05
DLI-GU
P
IC
X(4)
VALUE 'GU '.
05
DLI-ISRT PIC
X
(4) VALUE '
I
SRT'
.
01 RE
C
E
IVABL
E
-
S
EGMENT.
05 R-INVOICE-NUMBER
P
IC
X(6).
05 R-INVOICE-DATE
P
IC
X(6).
05 R-PO-N
U
M
BER
P
IC
X(6).
05 R-STAX
PIC
9
(4).
01 INVOICE-NO-SSA.
05 FIL
L
E
R
PIC
X
(9) VALUE
'R
EC
EISEG('.
05 FIL
L
E
R
PIC
X
(10) VALUE
'RE
C
EINVN
='.
05 INVOICE-NO-SSA-VALUE
PIC
X
(6).
05 F
I
LLER
P
I
C
X
V
A
LU
E '
)
'.
01
MFS-MOD-NAME
P
IC
X(8) VALUE 'MFSO
'.
IMS DC Slide: 33

LINKAGE SEC
T
ION.
01 IO-P
CB-MAS
K
.
05 IO-PCB-LOGICAL-T
E
R
M
PIC X(8).
05 FILLER
PIC
X(2).
05 IO-PCB-STATUS-COD
E
PIC
X
(2).
05 IO-PCB-D
A
T
E
PIC S9(7) CO
MP-3.
05 IO-PCB-TIME
PIC S9(6)V9 COMP
-3.
05 IO-PCB-MS
G-SEQ-NU
MBER
PIC
S
9(5) CO
MP.
05 IO-PCB-MOD-NA
ME
PIC X(8).
05 IO-PCB-U
S
ER-ID
PIC
X(8).
*
01 CR-PCB-MA
SK
.
05 CR-PCB-DBD-NA
ME
PIC X(8).
05 CR-PCB-SEGMENT-LEVEL PIC XX. 05 CR-PCB-STATUS-CODE

PIC XX.
05 CR-PCB-PROC-OPTIO
NS
P
I
C X(4).
05 FILLER
PIC S
9
(5) COMP.
05 CR-PCB-SEGMENT-NAME
PIC
X
(8).
05 CR-PCB-KEY-LENGTH
PIC S9(5) CO
MP.
05 CR-PCB-NU
MB-SENS-SEGS PIC S9(5) CO
MP.
05 CR-PCB-KEY
PIC
X(22).
IMS DC Slide: 34

PROCE
DURE DIVISION.
ENT
R
Y
'DLI
T
CBL
'
USING IO-PCB-MASK CR-PCB-MASK.
PER
F
ORM 100-PROCESS UNTIL END-OF-MESSAGES.
GOBACK.
100-PR
OCESS.
PERFORM 110-GE
T
-INPU
T-MESSAG
E
.
IF NOT END-OF-MESSAGES
PERFORM 120-GET-I
NVOICE-DATA
PERFORM 150-INSERT-OUTPUT
-
SEGMENT.
110-GET-INPUT-MESSAGE.
CALL
'CBLTDLI'
USING
DLI-GU
IO-P
CB-MAS
K
INPU
T-MESSAG
E
-IO-AREA.
IF IO
-PCB-STATUS-CODE = '
Q
C'
M
O
VE 'Y
' TO EN
D-
OF-MESSAGES-S
W
.
IMS DC Slide: 35

120-GET-INVO
ICE-DATA.
MOVE IN-INVNO
T
O INVOICE-NO-SSA-VALUE.
C
A
LL
'C
BLTDLI'
U
S
I
N
G

D
L
I-G
U
CR-PCB-MA
SK
RE
C
E
IVABLE-SEGMENT
INVOICE-NO-SSA.
IF CR-PCB-STATUS-CODE
NOT = SPACE
MOVE '
9999'
TO OP-STAX
ELS
E
MOVE R-INVOICE-NUMBE
R TO OP-INVNO
MOVE R-ST
AX TO OP-STAX.
150-IN
SERT-OUT
PUT-SEGMENT.
CALL
'CBLTDLI'
USIN
G
DLI-ISRT IO-PCB-M
A
SK
OUTPUT-MESSA
GE-IO-AREA
MFS-MOD-NAME.
IMS DC Slide: 36

Message Format Services
IMS DC Slide: 37

W
hat is
MFS?

C
ontrol Blocks

F
ormat Set –
M
FS, is an IMS feature that lets you use Formatted Display
Screens.

M
FS Modules reside in the IMS Control Region, and they
are invoked between IMS Communication Control Module and its Queue Manager.

M
FS can reduce system resources an application uses

MFS Control Blocks
IMS DC Slide: 38
Terminal
Device Input Format (
DIF
)
Device Output Format (
DOF
)
Mesg Input Descriptor (
MID
)
Mesg Output Descriptor (
MOD
)
Application Program
I
n
p
u
t

M
e
s
s
a
g
e
S
e
n
t

b
y

T
e
r
m
i
n
a
l
O
u
t
p
u
t

M
e
s
s
a
g
e
S
e
n
t

b
y

P
r
o
g
r
a
m
O
u
tp
u
t M
e
s
s
a
g
e
R
e
c
v
b
y
T
e
rm
in
a
l
I
n
p
u
t
M
e
s
sa
g
e
R
e
c
v
b
y
P
r
o
g
r
a
m

T
o process a Transaction, MFS uses 4 Control Blocks.

DIF & MID
IMS DC Slide: 39

F
or an Input Message, MFS uses a block called a
Device Input Format (DIF) to interpret data as it’s received from a Terminal.

I
t uses second Block called Message Input
Descriptor (MID), to determine how that input Data should be formatted for presentation to the Application Program.

IMS DC Slide: 40

F
or 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.

Format Set
IMS DC Slide: 41

M
FS control statements

M
FS
control statements are often referred as Format Set.
•F
o
r
m
a
t
S
e
t
:

D
efines the way screens to be used in application will look.

D
efines format of input & output messages.

S
pecifies the relationship between data on the screen and
data in a message.

M
FS
Language Utility is used to Translate the Format Sets to
the Control Blocks.

/
Format <MOD name>

Format of an MFS Control Statement
IMS DC Slide: 42
•C
O
L
S

•1
-
8

L
a
b
e
l

10 -
14
Operation

16 -
71
Operand

72 Continuation
Char

T
hree Groups of MFS Statements:
Device Format Control Statements Message descriptor control statements Compilation Control Statements

Define a Screen in Format Set
IMS DC Slide: 43

O
ne set of Control statements for both -
f
or a 3270 same screen
format must be used for both input & Output

O
ne Set of Control statements for both DIF & DOF

D
evice Format begins with FMT & ends with FMTEND
•F
M
T
DEV
DIV
DPAGE
DFLD DFLD
DPAGE
FMTEND

FMT
IMS DC Slide: 44

F
MT: Identifies the beginning of a device format

F
MTEND: Control statements end with a FMTEND statement

N
o parameters

A
ppropriate Label on FMT

L
abel coded on FMT statement can be no more than six
characters long.

Format Set
IMS DC Slide: 45
INQDF FMT
DEV TYPE=(3270,2),FEAT=IGNORE,DSCA=X’OOAO’ DIV TYPE=INOUT DPAGE C
URSOR=((1,2))
TRANINV
DFLD
PO
S=(1
,2
),LTH
=
15
O
U
TTEXT
DFLD
PO
S=(3
,2
),LTH
=
70
2
FMTEND
INQO MS
G TYPE=
OUTP
UT
,SOR=(INQDF,
IGNORE),NXT=INQI
SE
G
MFLD
OUTTEXT
,LTH=702
MS
GEND
INQI MS
G TY
PE=INPUT,SO
R=(INQDF,IG
N
ORE),NXT=INQ
O
SEG MFLD
TRANINV
,LTH=15
MS
GEND
END

DEV Control Statement
IMS DC Slide: 46

P
FKDF FMT
DEV
T
YPE=(3270,1)
FEAT = IGNORE PFK=(PFKTEXT,1=‘01’,2=‘02’,8=‘08’)
FMTE
ND
PFKEXI MSG TYPE=INPUT,
SOR=(PFKDF,IGNORE), NXT=PFKDFO
SEG MFLD
PFKTEXT
,
LTH=2
MSGEND

DEV
IMS DC Slide: 47

T
YPE: Specify the device models for which device format
blocks should be created.

D
SCA: To specify a default terminal action that’s performed
when an output message is sent to a 3270 device. Ex: DSCA=X’00A0’ causes unprotected fields on the screen to be erased before the output message is displayed.

S
YSMSG: Names a device field in which messages that come
to the terminal from IMS will be displayed.
•D
P
A
G
E
:

Primary Function Handle Multiple logical pages Secondary Function: Initial Cursor positioning & Field Fill

Program Function Keys (PFKeys)
IMS DC Slide: 48

P
FK parameter specifies how MFS should support program
function keys.

F
irst Part: Target input message field

S
econd Part: Keyword / positional format

P
ositional:
PFK=(PFKTEXT,‘01’,‘02’,,,,,,‘08’)

DEV
T
YPE= (3270,1)
(3270,2) 3270-An
,FEAT=IGNORE [,P
FK=(pfkeyfield,[integer=] ‘literal’
NEXTPP NEXTMSGP [,…])] E
NDMPP1
IMS DC Slide: 49

DPAGE
IMS DC Slide: 50

L
abel DPAGE [CURSOR=(LINE,COL,CFIELD)…]
[FILL=fillchar] [MULT=Yes]

F
ILL: The fill character to be used for output device fields.
Ex: PT, C’c’, X’hh’

M
ULT: Multiple physical pages w
ithin device page can be used
to generate an input message.

DFLD
IMS DC Slide: 51

S
pecifies where on the screen a
field is located & how large the
field is.

N
eed to code a label only when the device field it defines are to
be related with a input, output or both.

LTH : Not to be coded for a Literal in a device field

D
FLD ‘ABC Company Services’,
POS=(1,2), ATTR=(HI,PROT)

C
URDATE DFLD POS=(1,72),
LTH=8 ATTR=(HI,PROT)

DFLD Statement
IMS DC Slide: 52

A
TTR: Field Characteristics

D
efault Protection attribute for
a non-literal field is unprotected

L
abel
DFLD ‘literal’, POS=(1,1), LTH=20, ATTR=ALPHA

A
TTR=

A
LPHA / NUM
•N
O
P
R
O
T
/
P
R
O
T

NORM/NODISP/HI

NOMOD/MOD

Modified Data Tags
IMS DC Slide: 53

M
DT 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.

W
hen a screen is displayed, MDT’s of fields is OFF.

A
dvantage: Telecommunications Efficiency

Define Messages in a Format Set
IMS DC Slide: 54

C
ode separate sets of control st
atements to define a MID and a
MOD.

B
egin with a MSG & end with a MSGEND.

M
OD: TYPE=OUTPUT

M
ID: TYPE=INPUT

M
ust code a label on the MSG statement.

M
essage 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.

Message Descriptor Control Statements
IMS DC Slide: 55
•M
S
G
LPAGE
PASSWORD
MFLD
SEG
MFLD MFLD
LPAGE
SEG
MFLD
MSGEND

MSG
IMS DC Slide: 56

m
sgname
MSG TYPE=(INPUT / OUTPUT )
SOR =(dfname,IGNORE)
NXT=nextmsgname PAGE=YES
MSGEND

S
OR: Parameter on each MSG statement. Code the name of the
device format (FMT statement labe
l) that is associated with the
message this group of statements define.

NXT: Parameter specifies the message descriptor MFS that will be used. MSG that defines a MID you code a MOD and for MOD you code the MID label.

MFLD Control Statement
IMS DC Slide: 57

M
FLD {SOURCE / DESTINATION }
LTH = Length JUST={L / R} FILL=fillchar ATTR=(YES)

I
nput Message Field Descriptor:-
MFLD ‘DI2 ‘, LTH=8 MFLD INVNO,LTH=6 MFLD (INVNO,’000000’),LTH=6 •
O
utput Message field:-
MFLD (CURDATE,DATE2)

JUST, FILL,
ATTR
parameter in MFLD Statement
IMS DC Slide: 58

J
UST parameter specifies how data should be positioned in a
message field.

D
efault is Left Justification

F
ILL parameter specifies what
pad character MFS should use to
complete a field when the data that’s mapped into it doesn’t fill. you with Ex: FILL=C’0’
FILL=X’ ‘ FILL=NULL

A
TTR = YES specifies that an application program can
dynamically change the attribut
es set in the Device field.

Compilation Control Statements
IMS DC Slide: 59

P
RINT ON,NOGEN
•P
R
I
N
T
O
F
F
•E
N
D
•E
J
E
C
T

C
OPY

s
ymbol EQU ‘literal’
APA EQU ‘ATTR=(PROT,ALPHA)’ SUBTOTAL DFLD POS=(3,55),LTH=9,APA

IMS DC Slide: 60

B
y default : Same MOD to be used for an output message that
was used for the previous entry.

C
omplex Screen Flows:

W
hen output formats are changed, when 2 or more screen
displays are used.

IMS DC Slide: 61

F
ormat of the ISRT call with the MOD name segment
CALL ‘CBLTDLI’ USING DLI-ISRT
IO-PCB-MASK OUTPUT-MESSAGE-IO-AREA MFS-MOD-NA
ME.
MFS-MOD-NAME is a working storage field defined with PIC X(8).

H
ow to Control screen flows from within MFS ?
Easy to control screen flows from within an application without involving application program. Provide a way for the operator to cause an input message that begins with: /format mod-name

Screen Example
IMS DC Slide: 62

R
eceivables Menu
Date: xxxxxxx
PF1 Enter Cash Receipts PF2 Display Invoice Summary

Format Set for Menu Program
IMS DC Slide: 63

M
ENUDF F
M
T
DEV TYPE=(3270,2),
F
EAT=IGNORE,SYSMSG
=ERRMSG,

PFK=(PFKFIELD,’/FOR CR
O ‘,
’/FOR DI2O ‘,’/FOR DIDSO’)
DI
V TYPE=INPUT
DFLD ‘Receivables
Menu’,POS=(1,2),ATTR=
(PROT,ALPHA,HI,NOMOD)
DFLD ‘Date’,POS=
(
1,65
),ATTR=(PROT,ALPHA,HI,NOMOD)
CURDATE DFLD POS=(1,72)
,LTH=9,ATTR=(PROT,ALPHA,HI,NOMOD)
…………………………………...
ERRMSG
DFLD
POS(23,
2),L
TH=
79,ATTR=(PROT,ALPHA,NORM,NOMOD)
F
M
TEND
MENUI MSG TYPE=INP
UT,SOR=(MENUDF,IGNORE),NXT=MENUO
SEG MFLD
PFKFIELD,LTH=10
MSGEND
MENUO MSG TYPE=OUT
,SOR=(MENUDF,IGNORE),NXT=MENUI
SEG MFLD (CURDATE,DATE2
)
MFLD LTH=1 MSGEND

IMS DC Slide: 64

F
ield attributes values set with ATTR parameter of DFLD
statement and CURSOR parameter of the DPAGE statement could be dynamically changed.

U
sed to call attention to data entry errors.
•S
t
e
p
s
:
-

I
dentify fields that are eligible for dynamic field attribute
modifications by setting ATTR
= YES in MFLD statement.

Identifying the Output Message Fields
IMS DC Slide: 65
•S
t
e
p
s
:
-

I
dentify fields that are eligible for dynamic field attribute
modifications by setting ATTR = YES in MFLD statement.

2
bytes of MFLD will contain control information that specifies
what the overriding attributes will be.

I
ncrease the LTH of the Message Field by 2.

M
FLD INVNO,LTH=8,ATTR=YES

T
wo bytes prefix is packed with information.

F
irst byte is cursor control. If cursor positioning is not required
all the bits in the first control byte should be 0000 0000. (Low Values)

Specify Field Attributes overrides from a Program
IMS DC Slide: 66
05 OM-INVOICE-NO.
10 OM-INVOICE-NO-PREFIX.
15 OM-INVOICE-NO-CURSOR PIC X VALUE LOW-VALUE. 15 OM-INVOICE-NO-AT
TR PIC X.
10 OM-INVOICE-NO-DATA PIC X(6).

E
x: A common functi
on is changing fi
elds intensity from normal to bri
g
ht
without changing other attributes. 1000
0000 is required in second byte.

05 ATTR-CHANGE-TO-BRIGHT PIC X VALUE ‘h’.

S
etting a fields default attribute: 1000 0000, hex 80
05 ATTR-RESET-TO-DEFAULT
PIC X VALUE ‘ ‘.

T
o mark a field with error, MOVE ATTR-CHANGE-TO-BRIGHT TO OM-INVOICE-NO-ATTR

Cursor & Attribute Control
Firs
t b
y
te
(Curs
o
r C
o
ntrol
)
S
e
c
o
nd
B
y
te
(
A
ttrib
ute
Control)
0
0
0
0
0
0
1
0
B
i
t
0
1
2
3456
70123
4
567
Cu
r
s
o
r
Pos
i
t
i
on
i
n
g
Sh
if
t
I
n
t
en
s
i
t
y
P
e
n
M
DT
Prot
e
c
t
i
on
At
t
r
ib
u
t
e O
v
er
r
i
d
e
Byt e
B
i
ts
Fu
n
c
ti
o
n
V
a
l
u
e
s
1
0
-
1
C
u
r
s
o
r
P
o
s
.
0
0
C
u
r
s
o
r
P
o
s
i
ti
o
n
i
n
g n
o
t r
e
qu
e
s
te
d
1
1
P
o
s
i
ti
o
n
c
u
r
s
o
r

a
t
th
i
s
fi
e
l
d.
(
V
a
l
u
e
s
0
1
a
n
d 1
0
a
r
e
i
n
v
a
l
i
d
)
2-7
0
0000
0
(
A
l
wa
y
s
)
20
1
(
A
l
w
a
y
s
)
1
A
tt
r
i
bu
te
O
v
e
r
r
i
de
T
y
pe
0
U
s
e
th
e
a
ttr
.
S
p
e
c
i
f
i
c
a
t
i
o
n
s
th
a
t
fo
l
l
o
w
to

a
c
ti
v
a
te
o
n
l
y

s
p
e
c
i
f
i
e
d
a
ttr
i
b
u
t
e
s
(
t
h
a
t i
s
a
ttr
i
b
u
t
e
s
w
h
o
s
e

c
o
r
r
e
s
p
o
n
d
i
n
g o
v
e
r
r
i
d
e
bi
t
i
s
o
n
1
U
s
e
t
h
e
at
t
r
ib
u
t
e s
p
ec
s
t
h
at
f
o
l
l
o
w
t
o

r
e
p
l
a
c
e all
d
e
v
i
c
e
f
i
el
d
at
t
r
ib
u
2
P
r
o
te
c
t
.
A
ttr
.
0
U
n
pr
o
t
e
c
te
d
1P
r
o
t
e
c
t
e
d
3
S
h
i
f
t
At
t
r
ib
u
t
e
0
Alp
h
a
n
um
er
i
c
Sh
if
t
1N
u
m
e
r
i
c
S
h
i
f
t
4
-
5
I
n
t
e
n
s
i
ty
A
ttr
i
b
0
0
N
o
r
m
a
l
I
n
te
n
s
i
t
y
01
N
o
-d
i
s
p
l
a
y
10
Br
ig
ht
I
n
t
e
n
s
it
y
11
Br
ig
ht
I
n
t
e
n
s
it
y
6
L
i
g
ht
-
p
e
n
A
t
t
r
0
S
ho
u
l
d
be
0 f
o
r
n
o
n-
L
i
g
h
t

P
e
n a
p
p
l
i
c
a
t
i
o
n
s
7
M
DT
0
M
DT
o
f
f
1M
D
T
o
n
IMS DC Slide: 67

Control the cursor
IMS DC Slide: 68

T
wo type we can position the cursor from an application
Program: Field Oriented Cursor control Absolute Cursor Control

F
ield Oriented Cursor
To require cursor positioning at a field, move the left brace hex value, hex C0, binary 1100 0000 to
the first of the two control
bytes. Don’t want Cursor positioning at
a field, first byte of the prefix
should contain Low-Value.

Absolute Cursor Control
IMS DC Slide: 69

P
rogram specifies the exact column & line position where the
cursor will be located.

C
URSOR parameter of D
P
AGE statement:
CURSOR=(line,column,cfield) MFLD CFIELD,LTH=4

05 IM-CURSOR-LOCATION.
10 IM-CURSOR-LINE PIC S9(3) COMP.
10 IM-CURSOR-COLUMN PIC S9(3) COMP.

IMS DC Slide: 70

P
aging: Is a facility that lets message be broken down into
components for display, for processing or for both.

P
hysical Paging / Logical Paging

P
hysical Paging: A message with a fixed number of segments is
further divided into parts that are sized properly for a particular device.

I
mplement physical paging through the DFLD statement. Ex: POS=(8,12,3)

IMS DC Slide: 71
FIELD3 DFLD POS=(3,12)
FIELD3 DFLD POS=(3,12)
FIELD4 DFLD POS=(4,12) FIELD4 DFLD POS=(4,12) …………………………… …………………….. FIELD14 DFLD POS=(14,12) FIELD14 DFLD POS=(3,12,2) FIELD15 DFLD POS=(15,12) FIELD15 DFLD POS=(3,12,2) FIELD16 DFLD POS=(16,12) FIELD16 DFLD POS=(3,12,2) FIELD17 DFLD POS=(17,12) FIELD17 DFLD POS=(3,12,2) FIELD18 DFLD POS=(18,12)
FIELD18 DFLD POS=(3,12,2)

O
perator Physical Paging: Program Function keys could be
used.

P
FK=(PFKIN,08=NEXTPP,10=NEXTMSGP)

Multiple Physical Page Input
IMS DC Slide: 72

M
FS provides a facility to generate a single physical input
message from multiple physical pages. DPAGE Stmt MULT=YES

O
perations:

O
perator presses ENTER key for each Screen

P
F1 to skip over the screen without making an entry

O
perator can use a PF key associated with MFS operator
command ENDMPPI to signal to MFS that multiple physical page input is over and comp
lete input message can be
constructed.

C
URSOR=((3,12),(3,12)),MULT=YESS

Logical Paging
IMS DC Slide: 73

A
logical page is usually associated with a single screen image.

W
ith logical paging, we can send multiple occurrences of the
same screen, but with different data, as part of one output message.

L
ogical paging is often used for applications that produce
relatively large amounts of output.

A
group of related fields either on the screen or in a message is
called a Logical page.

L
ogical Page implemneted by LPAGE & DPAGE

D
PAGE: Device Page, 1 -
8
char label to link to Lpage

L
PAGE: Message Page

Operator Logical Paging Commands
IMS DC Slide: 74

C
ommand
Action

=
Move Forward one logical page

=
nnn Move to logical page nnn

=
l Move to last logical page

=
-nnn
Move backward nnn logical pages

=
+nnn
Move forward nnn logical pages

F
or the operator to use the logical paging commands, a device
field should be present into which he can enter paging commands.

How to define message pages
IMS DC Slide: 75

L
PAGE, no other function other than logical pages

C
odes only in format sets that don’t use logical paging

L
PAGE -
D
PAGE relationship:

S
UMLPAGE LPAGE SOR=SUMDPAGE,….

H
ow does MFS know which LPAGE to select?

P
rogram has to move an identifying value to a particular field
in the output message segment. SUMLPAGE LPAGE SOR=SUMDPAGE,
COND=(LPAGEID=,’S’)
SEG
LPAGEID MFLD LTH=1

How to support operator logical paging
IMS DC Slide: 76

E
nable Operator logical paging
PAGE = YES (on the MOD)

T
he above statement tells MFS to examine a related input
message to see if they begin with an operator logical paging command.
PAGECMD DFLD POS(22,17),LTH=5,
ATTR(NOPROT,ALPHA,NORM,NOMOD)
SEG MFLD PAGECMD,LTH=5,

IMS DC Slide: 77

Alternate Destination Concepts :

T
he application Program that’s processing a
Single Input Message can send multiple Output Message to Multiple Destinations.

I
SRT call is issued but only difference is that
the call specifies
Alternate PCB
instead of
I/O PCB.

IMS DC Slide: 78

A
lternate PCB (ALTPCB), which are
specified in the programs PSBGEN job, name the other terminals or transactions to which the program can send Messages.
Application Program
Data Base
Terminal
Printer
Input Message
Output Message (IOPCB)
O
u
t
p
u
t
M
es
s
ag
e
(
A
L
T
P
C
B
)

IMS DC Slide: 79

Conversational Application
–T
h
e
r
e
a
r
e
three
ways to maintain Data
between Terminal Interaction.

S
tore Data in the Terminal Screen.

S
tore Data in the Databases

S
tore Data in the IMS provided Scratch Pad
Area.

IMS DC Slide: 80

Advantages & Disadvantages of these Techniques.

T
he First technique, is suitable only if the
Data is Simple & Non-Critical.

T
he Second Technique, makes your Program
more complicated and less efficient.

T
he Last Technique, is to use a special area
IMS provides just for that Purpose :
The
Scratch Pad Area
(SPA).

IMS DC Slide: 81

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.

IMS DC Slide: 82

Using SPA:

D
efine I/O Area for SPA :
01 SPA-IO-AREA.
05 SPA-LL
P
IC S9(4) COMP.
05 SPA-ZZ
P
IC S9(4) COMP.
05 SPA-CI
P
IC S9(4) COMP.
05 SPA-T
RAN-CODE
PIC X(8).
05 SPA-USER-DATA
P
IC X(---).

T
he area is much similar to the Message Segment

I
n Addition to LL &
Z
Z
f
ields, the SPA contains a Third
binary
halfword
CI (Conversational Identifier) which
I
MS
uses to keep track of SPA.

IMS DC Slide: 83

IMS Calls in Conversational Programs :

I
n 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.

IMS DC Slide: 84

T
o save Data in the SPA, an ISRT call is issued
against I/O PCB. CALL ‘CBLTDLI’ USING
D
LI-ISRT
IO-PCB-MASK SPA-IO-AREA

Y
ou must not send an output Message Segment
before you have saved the SPA.

A
t the start of conversation, the SPA is set to Binary
Zeros.

IMS DC Slide: 85

Program Switching :

S
witching from on Conversational Program to
Another requires that both the SPA & Message to be processed by the second program be transferred.

T
here are two kinds of Program-to-Program
Message switches

I
mmediate Program Switching.

D
eferred Program Switching.


I
mmediate Program Switching :
Application Program -
1
Application Program -
2
Terminal
O
u
tp
u
t M
e
s
s
a
g
e
I
n
p
u
t

M
e
s
s
a
g
e
SPA
Switch Message Segment
IMS DC Slide: 86

IMS DC Slide: 87

T
he Program that receives the input Message is
not the same one that responds to the Terminal.

T
he First Program passes in SPA and other
necessary data to the second Program, which does additional processing and respond to the originating terminal.


D
eferred Program Switching :
Application Program -
1
Application Program -
2
Terminal
O
u
tp
u
t M
e
s
s
a
g
e
2
I
n
p
u
t

M
e
s
s
a
g
e
1
SPA
O
u
t
p
u
t

M
e
s
s
a
g
e

1
In
p
u
t M
e
s
s
a
g
e
2
IMS DC Slide: 88

IMS DC Slide: 89

A
single Conversation involves two different
Application Programs, one for each of two terminal Interactions.

T
he data stored in SPA is passed from the first
program to the Second.

T
he second program isn’t
invoked until the user
sends the next input message

T
his technique can impose less overhead on the
IMS system & can result in faster response.

IMS DC Slide: 90

Logging:

R
ecords all Database Updates, all Message
queued and all program scheduled.

T
hese Information can be used to restore the
system if a failure occurs.

IMS DC Slide: 91

M
TO (Master Terminal Operator) can
manage other terminals in the network, as well as messages & programs execution in dependant Regions.

T
he system maintains
mtologs
where the
necessary details are stored when the abend occurs.

IMS DC Slide: 92

Recovery:

I
MS 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.

IMS DC Slide: 93

Checkpointing:

T
he checkpoints are taken automatically with each
transaction a program processes. (This is called Single Mode Processing.)

I
n 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.

T
he Checkpoint Call Syntax: CALL ‘CBLTDLI’ USING
D
LI-CHKP
IO-PCB-MASK INPUT-MESG-IO-AREA.

Thank You
IMS
D
C
S
l
i
de: 94