Vous êtes sur la page 1sur 94

IMS DC

Pre-Requisite: IMS DB knowledge

IMS DC Slide: 1
An Introduction
• 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.

IMS DC Slide: 2
Interactive Programs

• Major Kinds of Online Programs that can be written:


– Inquiry Programs
– Data Entry Programs
– Maintenance Programs
– Menu Programs

IMS DC Slide: 3
COMPARISON BETWEEN ONLINE AND BATCH PROGRAMS

BATCH ONLINE

Pre-Determined Scheduling Arbitrary Scheduling by Users


Intervals
Necessary creation of Input Processing of Data as it occurs
Files
Lack of Access to current Data Data up-to-date and current
and available for Inquiry
Delay in Processing Erroneous Immediate error correction
Data
Databases cannot be shared Database can be shared with
with other updating programs other updating programs

IMS DC Slide: 4
Software Components of an IMS DC system

MVS address
Space Non VTAM
VTAM Terminals
Terminals

VTAM

MVS Address space MVS address


Space
VTAM Terminals
Communication
Control
IMS / VS control
region MPP region

Editing Modules MVS address


(MFS) Space

MPP region
QPOOL
Queue Manager

Message Queue Overflow MVS address


datasets Space

Logging
MPP region

Logging data sets


DLI
MVS address
Space

BMP region

Data base & datasets

IMS DC Slide: 5
IMS-DC OFFERS:

1. A way to improve customer and 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 online applications

IMS DC Slide: 6
Features of IMS:

1. Manages IMS-DC Terminal Network

2. Routes Messages for various destinations

3. Scheduling of messages

4. Manages resources allocated to IMS

5. Provides restart, recovery facilities

6. Interacts with Databases for data retrieval and updation

IMS DC Slide: 7
ELEMENTS OF AN IMS-DC ONLINE SYSTEM

¾ TERMINALS

¾ MESSAGES

¾ REGIONS

¾ PROGRAMS

¾ DATABASES

¾ IMS CONTROL BLOCKS

¾ IMS LOGS

IMS DC Slide: 8
IMS STANDS BETWEEN THE TERMINAL AND THE APPLICATION PROGRAM

IMS

INPUT
MESSAGE INPUT
MESSAGE

TERMINAL IMS DC
PROGRAM
OUTPUT
OUTPUT
MESSAGE
MESSAGE

PROCESS

DATABASE

IMS DC Slide: 9
IMS DC
• DC handles information in the form of messages that flow between remote terminals
and application programs.

• Programs & Databases that will run under the control of IMS must be defined in the
IMS system definition.

• Two main Categories of Resources:


Application Resources & Data communication Resources

• Types of IMS DC Application Programs:


BMP: Batch Message Processing, Scheduled by System operator
MPP: Message Processing Program, scheduled by IMS

IMS DC Slide: 10
• IMS/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)
• Message - is a unit of Data that gets transmitted between a
program and a Terminal
• Primary Inputs to and outputs from DC programs are messages.
• For each Input message, DC program does predictable
processing against its databases and sends an output message
that to User’s screen.

IMS DC Slide: 11
How IMS uses MVS regions
Regions in IMS.
TERMINAL TERMINAL

MPP
REGION
MPP
REGION
IMS/VS CONTROL
REGION

MPP
REGION
BMP
LOG DATASETS
REGION

DATABASE DATASETS

IMS DC Slide: 12
Control Region

– The main function of this region is that, all terminal,


Database, and Logging Operations associated with
IMS-DC programs are performed through this
Region.

IMS DC Slide: 13
MPP Region
• MPP Region
– is where IMS schedules & executes Message
Processing Programs.
– The Number of MPP Regions determines the
number of MPPs that can be active at any one time.
– A program that occupies an MPP Region runs until
it has processed all of the input messages that IMS
has received for it. Then it ends, and the MPP
region in which it was running is freed and made
available for another Application Program.

IMS DC Slide: 14
Batch Message Program
• BMP (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.
– 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.

IMS DC Slide: 15
Terminals & Security under IMS
• 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
• Master Terminal

IMS DC Slide: 16
Terminals & Security under IMS
• SMU Security Maintenance Utility
RACF Resource Allocation & Control Facility

• Transaction Security

• SIGN ON verification

• LTERM security

IMS DC Slide: 17
How IMS Manages Input messages
• Three kinds of IMS input messages:
a. Transactions
b. Terminal to Terminal message
c. IMS commands
• IMS uses first 8 bytes of an input message to identify the
message’s type.

• How IMS handles the three kinds of Input messages ???


• Input message Editing

IMS DC Slide: 18
Input Message Editing
• Two 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.

IMS DC Slide: 19
How IMS supports an Application Program
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, IMS makes scheduling
decisions.

IMS DC Slide: 20
IMS DC & CICS
• Many users are running an application, the IMS system funnels
all of their messages through one program.
• CICS treats each user separately, it treats each terminal user
separately.
• Many 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 where each message came from and
where each output message should go.

IMS DC Slide: 21
IMS-DC Processing

Programming Elements for IMS-DC Processing


– DL/I Calls for DC Operation
– PCB mask for DC Operation
– Message Handling.

IMS DC Slide: 22
DL/I calls for DC operations
• Basic unit of I/O for data communication DL/I call is segment
• Most messages consist of just one segment occurrence, some
may contain multiple segments.
• Message segments are not arranged hierarchically, they just
represent parts of a message.

•A Data Base Call •A Data communication Call


•CALL ‘CBLTDLI’ USING •CALL ‘CBLTDLI’ USING
DLI-GU DLI-GU
DB-PCB-MASK IO-PCB-MASK
RSEGMENT RSEGMENT.
INV-SSA.

IMS DC Slide: 23
DL/I calls for DC Operation
• CALL ‘CBLTDLI’ USING DLI-GU
IO-PCB-MASK
INPUT-MESSAGE-SEG.
• First argument is the Function Code
• GU: Issue a GU call to retrieve the first segment of an Input
Message.
• GN is issued to retrieve the subsequent Messages.
• ISRT call is issued for each segment, to send an Output
Message.

IMS DC Slide: 24
PCB Mask for DC operation
• A DC call must specify a Linkage Section PCB Mask, which is
a special one that’s just for Message Processing. It’s called I/O
PCB.

• To provide 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.
• Format of a I/O PCB is different from a data base PCB’s format.

IMS DC Slide: 25
Cobol Code for an I/O PCB mask.
• 01 IO-PCB-MASK.
05 IO-PCB-LOGICAL-TERMINAL PIC X(8).
05 FILLER PIC X(2).
05 IO-PCB-STATUS-CODE PIC X(2).
05 IO-PCB-DATE PIC S9(7) COMP-3
05 IO-PCB-TIME PIC S9(6)V9 COMP-3
05 IO-PCB-MSG-SEGMENT-NUMBER PIC S9(5) COMP.
05 IO-PCB-MOD-NAME PIC X(8).
05 IO-PCB-USER-ID PIC X(8).

IMS DC Slide: 26
Message Handling

– When 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.
– When ISRT call is issued to send an output Message
Segment, DL/I gets the Data from the specified I/O
Area.

IMS DC Slide: 27
Retrieving an Input Message
• Application Program issues either a Single ‘GU’ call or a ‘GU’
call followed by one or more ‘GN’ calls.
• To retrieve 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.
• To 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’ calls repeatedly until ‘QD’
status code is encountered.

IMS DC Slide: 28
Send an Output Message
• Issue ISRT calls that specify the I/O PCB.

• The Program issues a separate ISRT calls for each segment (for
Multiple Segments) to be written.

• I/O Area to be build before you issue this call

IMS DC Slide: 29
Input Message I/O Area Format
• Input Message I/O Area Format

LL Data

ZZ
•LL – Length of Entire Segment Usage: S9(3) Comp
•ZZ – IMS Reserved Data Usage: S9(3) Comp

IMS DC Slide: 30
Output Message I/O Area Format

LL Data

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

IMS DC Slide: 31
COBOL PROGRAM -

IDENTIFICATION DIVISION.
PROGRAM-ID. PGM01.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 SWITCHES.
05 END-OF-MESSAGES-SW PIC X VALUE 'N'.
88 END-OF-MESSAGES VALUE 'Y'.

01 INPUT-MESSAGE-IO-AREA.
05 IN-LL PIC S9(3) COMP.
05 IN-ZZ PIC S9(3) COMP.
05 IN-TRAN-CODE PIC X(8).
05 IN-INVNO PIC X(6).

01 O-TEMP PIC X(2000).


01 OUTPUT-MESSAGE-IO-AREA.
05 OP-LL PIC S9(3) COMP-3 VALUE +14C.
05 OP-ZZ PIC S9(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 PIC X(4) VALUE 'GU '.
05 DLI-ISRT PIC X(4) VALUE 'ISRT'.

01 RECEIVABLE-SEGMENT.
05 R-INVOICE-NUMBER PIC X(6).
05 R-INVOICE-DATE PIC X(6).
05 R-PO-NUMBER PIC X(6).
05 R-STAX PIC 9(4).

01 INVOICE-NO-SSA.
05 FILLER PIC X(9) VALUE 'RECEISEG('.
05 FILLER PIC X(10) VALUE 'RECEINVN ='.
05 INVOICE-NO-SSA-VALUE PIC X(6).
05 FILLER PIC X VALUE ')'.

01 MFS-MOD-NAME PIC X(8) VALUE 'MFSO '.

IMS DC Slide: 33
LINKAGE SECTION.

01 IO-PCB-MASK.
05 IO-PCB-LOGICAL-TERM PIC X(8).
05 FILLER PIC X(2).
05 IO-PCB-STATUS-CODE PIC X(2).
05 IO-PCB-DATE PIC S9(7) COMP-3.
05 IO-PCB-TIME PIC S9(6)V9 COMP-3.
05 IO-PCB-MSG-SEQ-NUMBER PIC S9(5) COMP.
05 IO-PCB-MOD-NAME PIC X(8).
05 IO-PCB-USER-ID PIC X(8).
*
01 CR-PCB-MASK.
05 CR-PCB-DBD-NAME PIC X(8).
05 CR-PCB-SEGMENT-LEVEL PIC XX.
05 CR-PCB-STATUS-CODE PIC XX.
05 CR-PCB-PROC-OPTIONS PIC X(4).
05 FILLER PIC S9(5) COMP.
05 CR-PCB-SEGMENT-NAME PIC X(8).
05 CR-PCB-KEY-LENGTH PIC S9(5) COMP.
05 CR-PCB-NUMB-SENS-SEGS PIC S9(5) COMP.
05 CR-PCB-KEY PIC X(22).

IMS DC Slide: 34
PROCEDURE DIVISION.
ENTRY 'DLITCBL' USING IO-PCB-MASK CR-PCB-MASK.

PERFORM 100-PROCESS UNTIL END-OF-MESSAGES.


GOBACK.

100-PROCESS.
PERFORM 110-GET-INPUT-MESSAGE.
IF NOT END-OF-MESSAGES
PERFORM 120-GET-INVOICE-DATA
PERFORM 150-INSERT-OUTPUT-SEGMENT.

110-GET-INPUT-MESSAGE.
CALL 'CBLTDLI' USING DLI-GU
IO-PCB-MASK
INPUT-MESSAGE-IO-AREA.
IF IO-PCB-STATUS-CODE = 'QC'
MOVE 'Y' TO END-OF-MESSAGES-SW.

IMS DC Slide: 35
120-GET-INVOICE-DATA.
MOVE IN-INVNO TO INVOICE-NO-SSA-VALUE.
CALL 'CBLTDLI' USING DLI-GU
CR-PCB-MASK
RECEIVABLE-SEGMENT
INVOICE-NO-SSA.
IF CR-PCB-STATUS-CODE NOT = SPACE
MOVE '9999' TO OP-STAX
ELSE
MOVE R-INVOICE-NUMBER TO OP-INVNO
MOVE R-STAX TO OP-STAX.

150-INSERT-OUTPUT-SEGMENT.
CALL 'CBLTDLI' USING DLI-ISRT
IO-PCB-MASK
OUTPUT-MESSAGE-IO-AREA
MFS-MOD-NAME.

IMS DC Slide: 36
Message Format Services
• What is MFS?
• Control Blocks
• Format Set

– MFS, is an IMS feature that lets you use Formatted Display


Screens.
– 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 an application uses

IMS DC Slide: 37
MFS Control Blocks
• To process a Transaction, MFS uses 4 Control Blocks.

Mesg Input Input Messa


ge
M e ssa g e Device Input Recv by Pro
np u t i na l Descriptor gram
I T erm Format (DIF)
by Application
Sent (MID)
Program

Terminal
Mesg Output
Out Device Output
put Descriptor
Rec Me s s ag e
v by ssage Format (DOF) ut M
e
Term (MOD) Outp Pr o g r am
inal by
Sent

IMS DC Slide: 38
DIF & MID
– For an Input Message, MFS uses a block called a
Device Input Format (DIF) to interpret data as it’s
received from a Terminal.

– It uses second Block called Message Input


Descriptor (MID), to determine how that input Data
should be formatted for presentation to the
Application Program.

IMS DC Slide: 39
– For an Output Message, MFS uses similar blocks, a
Message Output Descriptor (MOD) is used to
interpret Data Received from the Application
Program.
– A Device Output Format (DOF), is used to
determine how that Data should be formatted for
Transmission to the Terminal.

IMS DC Slide: 40
Format Set
• MFS control statements
– MFS control statements are often referred as Format Set.
• Format Set:
– Defines the way screens to be used in application will look.
– Defines format of input & output messages.
– Specifies the relationship between data on the screen and
data in a message.
• MFS Language Utility is used to Translate the Format Sets to
the Control Blocks.

• /Format <MOD name>

IMS DC Slide: 41
Format of an MFS Control Statement
• COLS
• 1-8 Label
• 10 - 14 Operation
• 16 - 71 Operand
• 72 Continuation Char

• Three Groups of MFS Statements:


Device Format Control Statements
Message descriptor control statements
Compilation Control Statements

IMS DC Slide: 42
Define a Screen in Format Set
• One set of Control statements for both - for a 3270 same screen
format must be used for both input & Output
• One Set of Control statements for both DIF & DOF
• Device Format begins with FMT & ends with FMTEND
• FMT
DEV
DIV
DPAGE
DFLD
DFLD
DPAGE
FMTEND
IMS DC Slide: 43
FMT
• FMT: Identifies the beginning of a device format
• FMTEND: Control statements end with a FMTEND statement
• No parameters
• Appropriate Label on FMT
• Label coded on FMT statement can be no more than six
characters long.

IMS DC Slide: 44
Format Set
INQDF FMT
DEV TYPE=(3270,2),FEAT=IGNORE,DSCA=X’OOAO’
DIV TYPE=INOUT
DPAGE CURSOR=((1,2))
TRANINV 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

IMS DC Slide: 45
DEV Control Statement
• PFKDF FMT
DEV TYPE=(3270,1)
FEAT = IGNORE
PFK=(PFKTEXT,1=‘01’,2=‘02’,8=‘08’)

FMTEND
PFKEXI MSG TYPE=INPUT,
SOR=(PFKDF,IGNORE),
NXT=PFKDFO
SEG
MFLD PFKTEXT,
LTH=2
MSGEND

IMS DC Slide: 46
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.
Ex: DSCA=X’00A0’ causes unprotected fields on the screen to
be erased before the output message is displayed.
• SYSMSG: Names a device field in which messages that come
to the terminal from IMS will be displayed.
• DPAGE:
Primary Function Handle Multiple logical pages
Secondary Function: Initial Cursor positioning & Field Fill

IMS DC Slide: 47
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’)

IMS DC Slide: 48
DEV TYPE= (3270,1)
(3270,2)
3270-An
,FEAT=IGNORE
[,PFK=(pfkeyfield,[integer=] ‘literal’
NEXTPP
NEXTMSGP [,…])]
ENDMPP1

IMS DC Slide: 49
DPAGE
• Label DPAGE [CURSOR=(LINE,COL,CFIELD)…]
[FILL=fillchar]
[MULT=Yes]
• FILL: The fill character to be used for output device fields.
Ex: PT, C’c’, X’hh’
• MULT: Multiple physical pages within device page can be used
to generate an input message.

IMS DC Slide: 50
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 a input, output or both.
• LTH : Not to be coded for a Literal in a device field
• DFLD ‘ABC Company Services’,
POS=(1,2),
ATTR=(HI,PROT)
• CURDATE DFLD POS=(1,72),
LTH=8
ATTR=(HI,PROT)

IMS DC Slide: 51
DFLD Statement
• ATTR: Field Characteristics
• Default Protection attribute for a non-literal field is unprotected
• Label DFLD ‘literal’,
POS=(1,1),
LTH=20,
ATTR=ALPHA
• ATTR=
• ALPHA / NUM
• NOPROT/PROT
• NORM/NODISP/HI
• NOMOD/MOD

IMS DC Slide: 52
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 fields is OFF.
• Advantage: Telecommunications Efficiency

IMS DC Slide: 53
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.

IMS DC Slide: 54
Message Descriptor Control Statements
• MSG
LPAGE
PASSWORD
MFLD
SEG
MFLD
MFLD
LPAGE
SEG
MFLD
MSGEND

IMS DC Slide: 55
MSG
• msgname MSG TYPE=(INPUT / OUTPUT )
SOR =(dfname,IGNORE)
NXT=nextmsgname
PAGE=YES

MSGEND
• SOR: Parameter on each MSG statement. Code the name of the
device format (FMT statement label) 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.
IMS DC Slide: 56
MFLD Control Statement
• MFLD {SOURCE / DESTINATION }
LTH = Length
JUST={L / R}
FILL=fillchar
ATTR=(YES)
• Input Message Field Descriptor:-
MFLD ‘DI2 ‘, LTH=8
MFLD INVNO,LTH=6
MFLD (INVNO,’000000’),LTH=6
• Output Message field:-
MFLD (CURDATE,DATE2)

IMS DC Slide: 57
JUST, FILL, ATTR parameter in MFLD Statement
• JUST parameter specifies how data should be positioned in a
message field.
• Default is Left Justification

• FILL 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
• ATTR = YES specifies that an application program can
dynamically change the attributes set in the Device field.
IMS DC Slide: 58
Compilation Control Statements
• PRINT ON,NOGEN
• PRINT OFF
• END
• EJECT
• COPY
• symbol EQU ‘literal’
APA EQU ‘ATTR=(PROT,ALPHA)’
SUBTOTAL DFLD POS=(3,55),LTH=9,APA

IMS DC Slide: 59
• By default : Same MOD to be used for an output message that
was used for the previous entry.

• Complex Screen Flows:


• When output formats are changed, when 2 or more screen
displays are used.

IMS DC Slide: 60
• Format of the ISRT call with the MOD name segment
CALL ‘CBLTDLI’ USING DLI-ISRT
IO-PCB-MASK
OUTPUT-MESSAGE-IO-AREA
MFS-MOD-NAME.
MFS-MOD-NAME is a working storage field defined with
PIC X(8).
• How 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

IMS DC Slide: 61
Screen Example
• Receivables Menu Date: xxxxxxx

PF1 Enter Cash Receipts


PF2 Display Invoice Summary

IMS DC Slide: 62
Format Set for Menu Program
• MENUDF FMT
DEV TYPE=(3270,2),FEAT=IGNORE,SYSMSG=ERRMSG,
PFK=(PFKFIELD,’/FOR CRO ‘,’/FOR DI2O ‘,’/FOR DIDSO’)
DIV 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),LTH=79,ATTR=(PROT,ALPHA,NORM,NOMOD)
FMTEND
MENUI MSG TYPE=INPUT,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: 63
• Field attributes values set with ATTR parameter of DFLD
statement and CURSOR parameter of the DPAGE statement
could be dynamically changed.
• Used to call attention to data entry errors.
• Steps:-
• Identify fields that are eligible for dynamic field attribute
modifications by setting ATTR = YES in MFLD statement.

IMS DC Slide: 64
Identifying the Output Message Fields
• Steps:-
• Identify 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.
• Increase the LTH of the Message Field by 2.
• MFLD INVNO,LTH=8,ATTR=YES
• Two bytes prefix is packed with information.
• First byte is cursor control. If cursor positioning is not required
all the bits in the first control byte should be 0000 0000. (Low
Values)

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

• Ex: A common function is changing fields intensity from normal to bright


without changing other attributes. 1000 0000 is required in second byte.
• 05 ATTR-CHANGE-TO-BRIGHT PIC X VALUE ‘h’.
• Setting a fields default attribute: 1000 0000, hex 80
05 ATTR-RESET-TO-DEFAULT PIC X VALUE ‘ ‘.
• To mark a field with error,
MOVE ATTR-CHANGE-TO-BRIGHT TO OM-INVOICE-NO-ATTR

IMS DC Slide: 66
Cursor & Attribute Control
First byte (Cursor Control) Second Byte (Attribute Control)
0 0 0 0 0 0 1 0
Bit 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Cursor Shift Intensity Pen MDT
Positioning
Protection
Attribute Override

Byt Bits Function Values


e
1 0-1 Cursor Pos. 00 Cursor Positioning not requested
11 Position cursor at this field. (Values 01 and 10 are invalid)
2-7 000000 (Always)
2 0 1 (Always)
1 Attribute 0 Use the attr. Specifications that follow to activate only specified
Override Type attributes (that is attributes whose corresponding override bit is on
1 Use the attribute specs that follow to replace all device field attribu
2 Protect. Attr. 0 Unprotected
1 Protected
3 Shift Attribute 0 Alphanumeric Shift
1 Numeric Shift
4-5 Intensity Attrib 00 Normal Intensity
01 No-display
10 Bright Intensity
11 Bright Intensity
6 Light-pen Attr 0 Should be 0 for non- Light – Pen applications
7 MDT 0 MDT off
1 MDT on

IMS DC Slide: 67
Control the cursor
• Two type we can position the cursor from an application
Program:
Field Oriented Cursor control
Absolute Cursor Control
• Field 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.

IMS DC Slide: 68
Absolute Cursor Control
• Program specifies the exact column & line position where the
cursor will be located.
• CURSOR parameter of DPAGE 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: 69
• Paging: Is a facility that lets message be broken down into
components for display, for processing or for both.
• Physical Paging / Logical Paging
• Physical Paging: A message with a fixed number of segments is
further divided into parts that are sized properly for a particular
device.
• Implement physical paging through the DFLD statement.
Ex: POS=(8,12,3)

IMS DC Slide: 70
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)

• Operator Physical Paging: Program Function keys could be


used.
• PFK=(PFKIN,08=NEXTPP,10=NEXTMSGP)

IMS DC Slide: 71
Multiple Physical Page Input
• MFS provides a facility to generate a single physical input
message from multiple physical pages.
DPAGE Stmt
MULT=YES
• Operations:
• Operator presses ENTER key for each Screen
• PF1 to skip over the screen without making an entry
• Operator can use a PF key associated with MFS operator
command ENDMPPI to signal to MFS that multiple physical
page input is over and complete input message can be
constructed.
• CURSOR=((3,12),(3,12)),MULT=YESS
IMS DC Slide: 72
Logical Paging
• A logical page is usually associated with a single screen image.
• With logical paging, we can send multiple occurrences of the
same screen, but with different data, as part of one output
message.
• Logical 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.
• Logical Page implemneted by LPAGE & DPAGE
• DPAGE: Device Page, 1 - 8 char label to link to Lpage
• LPAGE: Message Page

IMS DC Slide: 73
Operator Logical Paging Commands
• Command 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

• For the operator to use the logical paging commands, a device


field should be present into which he can enter paging
commands.

IMS DC Slide: 74
How to define message pages
• LPAGE, no other function other than logical pages
• Codes only in format sets that don’t use logical paging
• LPAGE - DPAGE relationship:
– SUMLPAGE LPAGE SOR=SUMDPAGE,….
• How does MFS know which LPAGE to select?
• Program 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

IMS DC Slide: 75
How to support operator logical paging
• Enable Operator logical paging
PAGE = YES (on the MOD)
• The 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: 76
• Alternate Destination Concepts :
– The application Program that’s processing a
Single Input Message can send multiple
Output Message to Multiple Destinations.
– ISRT call is issued but only difference is that
the call specifies Alternate PCB instead of
I/O PCB.

IMS DC Slide: 77
– Alternate PCB (ALTPCB), which are
specified in the programs PSBGEN job,
name the other terminals or transactions to
which the program can send Messages.

Input Message

Terminal Output Message


(IOPCB) Application
Data
e Program
e ss ag Base
u t p ut M
O B)
Printer T P C
( AL

IMS DC Slide: 78
• Conversational Application
– There are three ways to maintain Data
between Terminal Interaction.
• Store Data in the Terminal Screen.
• Store Data in the Databases
• Store Data in the IMS provided Scratch Pad
Area.

IMS DC Slide: 79
• Advantages & Disadvantages of these Techniques.
– The First technique, is suitable only if the
Data is Simple & Non-Critical.
– The Second Technique, makes your Program
more complicated and less efficient.
– The Last Technique, is to use a special area
IMS provides just for that Purpose : The
Scratch Pad Area (SPA).

IMS DC Slide: 80
• 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: 81
• Using SPA:
– Define I/O Area for SPA :
01 SPA-IO-AREA.
05 SPA-LL PIC S9(4) COMP.
05 SPA-ZZ PIC S9(4) COMP.
05 SPA-CI PIC S9(4) COMP.
05 SPA-TRAN-CODE PIC X(8).
05 SPA-USER-DATA PIC X(---).

– The area is much similar to the Message Segment


– In Addition to LL & ZZ fields, the SPA contains a Third
binary halfword CI (Conversational Identifier) which IMS
uses to keep track of SPA.

IMS DC Slide: 82
• IMS Calls in Conversational Programs :
– In Conversational Programs, SPA should be
retrieved first before retrieving Message Segments.
This is done by issuing a ‘GU’ call against I/O PCB.

CALL ‘CBLTDLI’ USING DLI-GU


IO-PCB-MASK
SPA-IO-AREA.

IMS DC Slide: 83
– To save Data in the SPA, an ISRT call is issued
against I/O PCB.

CALL ‘CBLTDLI’ USING DLI-ISRT


IO-PCB-MASK
SPA-IO-AREA

– You must not send an output Message Segment


before you have saved the SPA.
– At the start of conversation, the SPA is set to Binary
Zeros.

IMS DC Slide: 84
• Program Switching :
– Switching from on Conversational Program to
Another requires that both the SPA & Message to
be processed by the second program be transferred.
– There are two kinds of Program-to-Program
Message switches
• Immediate Program Switching.
• Deferred Program Switching.

IMS DC Slide: 85
• Immediate Program Switching :

Application
ag e Program - 1
ess
ut M
Inp
Switch

SPA
Message
Terminal Segment
Ou t
put
Mes
sage Application
Program - 2

IMS DC Slide: 86
– The Program that receives the input Message is
not the same one that responds to the Terminal.

– The First Program passes in SPA and other


necessary data to the second Program, which
does additional processing and respond to the
originating terminal.

IMS DC Slide: 87
• Deferred Program Switching :

a g e 1 Application
e ss
p u tM 1 Program - 1
In s a ge
es
p u tM
t
Ou

SPA
Terminal
Inpu
tMes
sage
Ou t 2
put Application
Mes
sage Program - 2
2

IMS DC Slide: 88
– A single Conversation involves two different
Application Programs, one for each of two terminal
Interactions.
– The data stored in SPA is passed from the first
program to the Second.
– The second program isn’t invoked until the user
sends the next input message
– This technique can impose less overhead on the
IMS system & can result in faster response.

IMS DC Slide: 89
• Logging:
– Records all Database Updates, all Message
queued and all program scheduled.
– These Information can be used to restore the
system if a failure occurs.

IMS DC Slide: 90
– MTO (Master Terminal Operator) can
manage other terminals in the network, as
well as messages & programs execution in
dependant Regions.
– The system maintains mtologs where the
necessary details are stored when the abend
occurs.

IMS DC Slide: 91
• Recovery:
– IMS provides extensive facilities for
Recoveries in the event of failure
– If an Application Program Abends, IMS
automatically reverse or Rollback the
changes it has made to the Databases and
Message Queues.

IMS DC Slide: 92
• Checkpointing:
– The checkpoints are taken automatically with each
transaction a program processes. (This is called
Single Mode Processing.)
– In Multiple Mode Processing, the only automatic
checkpoint is at the End of the Program. However,
the program can force a checkpoint by issuing
CHKP call, which causes IMS to write a
Checkpoint Record to the Log.
– The Checkpoint Call Syntax:
CALL ‘CBLTDLI’ USING DLI-CHKP
IO-PCB-MASK
INPUT-MESG-IO-AREA.

IMS DC Slide: 93
Thank You

IMS DC Slide: 94

Vous aimerez peut-être aussi