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

IMS DC Self Study Complete Tutorial

Embed Size (px)

Citation preview

Page 1: IMS DC Self Study Complete Tutorial

IMS DC

IMS DC Slide: 1

Pre-Requisite: IMS DB knowledge

Page 2: IMS DC Self Study Complete Tutorial

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.

Note: DL/I DOS/VS does not support Data Communication Component.

Page 3: IMS DC Self Study Complete Tutorial

Interactive Programs

IMS DC Slide: 3

• Major Kinds of Online Programs that can be written:

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

Page 4: IMS DC Self Study Complete Tutorial

COMPARISON BETWEEN ONLINE AND BATCH PROGRAMS

IMS DC Slide: 4

BATCH ONLINE

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

Page 5: IMS DC Self Study Complete Tutorial

Software Components of an IMS DC system

Data base & datasets

CommunicationControl

Editing Modules(MFS)

Queue ManagerQPOOL

Message Queue Overflowdatasets

VTAM Terminals

MVS addressSpace

VTAM

Non VTAMTerminals

MVS Address space

IMS / VS controlregion

Logging

DLI

MVS addressSpace

MPP region

MVS addressSpace

MPP region

MVS addressSpace

MPP region

MVS addressSpace

BMP region

Logging data sets

VTAM Terminals

IMS DC Slide: 5

Page 6: IMS DC Self Study Complete Tutorial

IMS-DC OFFERS:

IMS DC Slide: 6

1. A way to improve customer and internal service by providingcurrent 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

Page 7: IMS DC Self Study Complete Tutorial

Features of IMS:

IMS DC Slide: 7

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

Page 8: IMS DC Self Study Complete Tutorial

ELEMENTS OF AN IMS-DC ONLINE SYSTEM

TERMINALS

MESSAGES

REGIONS

PROGRAMS

DATABASES

IMS CONTROL BLOCKS

IMS LOGS

IMS DC Slide: 8

Page 9: IMS DC Self Study Complete Tutorial

IMS STANDS BETWEEN THE TERMINAL AND THE APPLICATION PROGRAM

TERMINAL

DATABASE

IMS

INPUTMESSAGE

OUTPUTMESSAGE

INPUTMESSAGE

OUTPUTMESSAGE

PROCESS

IMS DCPROGRAM

IMS DC Slide: 9

Page 10: IMS DC Self Study Complete Tutorial

IMS DC

IMS DC Slide: 10

• 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 operatorMPP: Message Processing Program, scheduled by IMS

Page 11: IMS DC Self Study Complete Tutorial

IMS DC Slide: 11

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

Page 12: IMS DC Self Study Complete Tutorial

How IMS uses MVS regions

IMS DC Slide: 12

Regions in IMS.

IMS/VS CONTROL REGION

TERMINAL TERMINAL

LOG DATASETS

MPPREGION

MPPREGION

MPPREGIONBMP

REGION

DATABASE DATASETS

Page 13: IMS DC Self Study Complete Tutorial

Control Region

IMS DC Slide: 13

– 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 14: IMS DC Self Study Complete Tutorial

MPP Region

IMS DC Slide: 14

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

Page 15: IMS DC Self Study Complete Tutorial

Batch Message Program

IMS DC Slide: 15

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

Page 16: IMS DC Self Study Complete Tutorial

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• Master Terminal

Page 17: IMS DC Self Study Complete Tutorial

Terminals & Security under IMS

IMS DC Slide: 17

• SMU Security Maintenance UtilityRACF Resource Allocation & Control Facility

• Transaction Security

• SIGN ON verification

• LTERM security

Page 18: IMS DC Self Study Complete Tutorial

How IMS Manages Input messages

IMS DC Slide: 18

• Three kinds of IMS input messages:a. Transactionsb. Terminal to Terminal messagec. 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

Page 19: IMS DC Self Study Complete Tutorial

Input Message Editing

IMS DC Slide: 19

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

Page 20: IMS DC Self Study Complete Tutorial

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, IMS makes scheduling decisions.

Page 21: IMS DC Self Study Complete Tutorial

IMS DC & CICS

IMS DC Slide: 21

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

Page 22: IMS DC Self Study Complete Tutorial

IMS DC Slide: 22

IMS-DC Processing

Programming Elements for IMS-DC Processing

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

Page 23: IMS DC Self Study Complete Tutorial

DL/I calls for DC operations

IMS DC Slide: 23

• 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

•CALL ‘CBLTDLI’ USING

DLI-GU

DB-PCB-MASK

RSEGMENT

INV-SSA.

•A Data communication Call

•CALL ‘CBLTDLI’ USING

DLI-GU

IO-PCB-MASK

RSEGMENT.

Page 24: IMS DC Self Study Complete Tutorial

DL/I calls for DC Operation

IMS DC Slide: 24

• CALL ‘CBLTDLI’ USING DLI-GU IO-PCB-MASKINPUT-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.

Page 25: IMS DC Self Study Complete Tutorial

PCB Mask for DC operation

IMS DC Slide: 25

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

Page 26: IMS DC Self Study Complete Tutorial

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 PIC S9(7) COMP-305 IO-PCB-TIME PIC S9(6)V9 COMP-305 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).

Page 27: IMS DC Self Study Complete Tutorial

Message Handling

IMS DC Slide: 27

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

Page 28: IMS DC Self Study Complete Tutorial

Retrieving an Input Message

IMS DC Slide: 28

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

Page 29: IMS DC Self Study Complete Tutorial

Send an Output Message

IMS DC Slide: 29

• 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

Page 30: IMS DC Self Study Complete Tutorial

Input Message I/O Area Format

IMS DC Slide: 30

ZZ

LL Data

•LL – Length of Entire Segment Usage: S9(3) Comp

•ZZ – IMS Reserved Data Usage: S9(3) Comp

• Input Message I/O Area Format

Page 31: IMS DC Self Study Complete Tutorial

Output Message I/O Area Format

Z1

LL Data

•LL – Length of Entire Segment Usage: S9(3) Comp

•Z1 & Z2 – IMS Reserved Data Usage: X(2)

Z2

IMS DC Slide: 31

Page 32: IMS DC Self Study Complete Tutorial

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

Page 33: IMS DC Self Study Complete Tutorial

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

Page 34: IMS DC Self Study Complete Tutorial

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

Page 35: IMS DC Self Study Complete Tutorial

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-DATAPERFORM 150-INSERT-OUTPUT-SEGMENT.

110-GET-INPUT-MESSAGE.CALL 'CBLTDLI' USING DLI-GU

IO-PCB-MASKINPUT-MESSAGE-IO-AREA.

IF IO-PCB-STATUS-CODE = 'QC'MOVE 'Y' TO END-OF-MESSAGES-SW.

IMS DC Slide: 35

Page 36: IMS DC Self Study Complete Tutorial

120-GET-INVOICE-DATA.MOVE IN-INVNO TO INVOICE-NO-SSA-VALUE.CALL 'CBLTDLI' USING DLI-GU

CR-PCB-MASKRECEIVABLE-SEGMENTINVOICE-NO-SSA.

IF CR-PCB-STATUS-CODE NOT = SPACEMOVE '9999' TO OP-STAX

ELSEMOVE R-INVOICE-NUMBER TO OP-INVNOMOVE R-STAX TO OP-STAX.

150-INSERT-OUTPUT-SEGMENT.CALL 'CBLTDLI' USING DLI-ISRT

IO-PCB-MASKOUTPUT-MESSAGE-IO-AREAMFS-MOD-NAME.

IMS DC Slide: 36

Page 37: IMS DC Self Study Complete Tutorial

Message Format Services

IMS DC Slide: 37

• 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

Page 38: IMS DC Self Study Complete Tutorial

MFS Control Blocks

IMS DC Slide: 38

Terminal

Device InputFormat (DIF)

Device OutputFormat (DOF)

Mesg InputDescriptor(MID)

Mesg OutputDescriptor(MOD)

Application Program

Input Message

Sent by Terminal

Output Message

Sent by Program

Output MessageRecv by Terminal

Input MessageRecv by Program

• To process a Transaction, MFS uses 4 Control Blocks.

Page 39: IMS DC Self Study Complete Tutorial

DIF & MID

IMS DC Slide: 39

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

Page 40: IMS DC Self Study Complete Tutorial

IMS DC Slide: 40

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

Page 41: IMS DC Self Study Complete Tutorial

Format Set

IMS DC Slide: 41

• 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>

Page 42: IMS DC Self Study Complete Tutorial

Format of an MFS Control Statement

IMS DC Slide: 42

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

• Three Groups of MFS Statements:Device Format Control StatementsMessage descriptor control statementsCompilation Control Statements

Page 43: IMS DC Self Study Complete Tutorial

Define a Screen in Format Set

IMS DC Slide: 43

• 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

DEVDIV

DPAGEDFLDDFLD

DPAGEFMTEND

Page 44: IMS DC Self Study Complete Tutorial

FMT

IMS DC Slide: 44

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

Page 45: IMS DC Self Study Complete Tutorial

Format Set

IMS DC Slide: 45

INQDF FMTDEV TYPE=(3270,2),FEAT=IGNORE,DSCA=X’OOAO’DIV TYPE=INOUTDPAGE CURSOR=((1,2))

TRANINV DFLD POS=(1,2),LTH=15OUTTEXT DFLD POS=(3,2),LTH=702

FMTENDINQO MSG TYPE=OUTPUT,SOR=(INQDF,IGNORE),NXT=INQI

SEGMFLD OUTTEXT,LTH=702MSGEND

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

Page 46: IMS DC Self Study Complete Tutorial

DEV Control Statement

IMS DC Slide: 46

• PFKDF FMTDEV TYPE=(3270,1)

FEAT = IGNOREPFK=(PFKTEXT,1=‘01’,2=‘02’,8=‘08’)

FMTEND

PFKEXI MSG TYPE=INPUT,SOR=(PFKDF,IGNORE),NXT=PFKDFO

SEGMFLD PFKTEXT,

LTH=2MSGEND

Page 47: IMS DC Self Study Complete Tutorial

DEV

IMS DC Slide: 47

• 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

Page 48: IMS DC Self Study Complete Tutorial

Program Function Keys (PFKeys)

IMS DC Slide: 48

• 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 49: IMS DC Self Study Complete Tutorial

DEV TYPE= (3270,1)(3270,2)3270-An

,FEAT=IGNORE[,PFK=(pfkeyfield,[integer=] ‘literal’

NEXTPPNEXTMSGP [,…])]ENDMPP1

IMS DC Slide: 49

Page 50: IMS DC Self Study Complete Tutorial

DPAGE

IMS DC Slide: 50

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

Page 51: IMS DC Self Study Complete Tutorial

DFLD

IMS DC Slide: 51

• Specifies where on the screen a field is located & how large thefield 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=8ATTR=(HI,PROT)

Page 52: IMS DC Self Study Complete Tutorial

DFLD Statement

IMS DC Slide: 52

• 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

Page 53: IMS DC Self Study Complete Tutorial

Modified Data Tags

IMS DC Slide: 53

• 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

Page 54: IMS DC Self Study Complete Tutorial

Define Messages in a Format Set

IMS DC Slide: 54

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

Page 55: IMS DC Self Study Complete Tutorial

Message Descriptor Control Statements

IMS DC Slide: 55

• MSGLPAGE

PASSWORDMFLD

SEGMFLDMFLD

LPAGESEG

MFLDMSGEND

Page 56: IMS DC Self Study Complete Tutorial

MSG

IMS DC Slide: 56

• msgname MSG TYPE=(INPUT / OUTPUT ) SOR =(dfname,IGNORE)NXT=nextmsgnamePAGE=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.

Page 57: IMS DC Self Study Complete Tutorial

MFLD Control Statement

IMS DC Slide: 57

• MFLD {SOURCE / DESTINATION }LTH = LengthJUST={L / R}FILL=fillcharATTR=(YES)

• Input Message Field Descriptor:-MFLD ‘DI2 ‘, LTH=8MFLD INVNO,LTH=6MFLD (INVNO,’000000’),LTH=6• Output Message field:-

MFLD (CURDATE,DATE2)

Page 58: IMS DC Self Study Complete Tutorial

JUST, FILL, ATTR parameter in MFLD Statement

IMS DC Slide: 58

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

Page 59: IMS DC Self Study Complete Tutorial

Compilation Control Statements

IMS DC Slide: 59

• PRINT ON,NOGEN• PRINT OFF• END• EJECT• COPY • symbol EQU ‘literal’

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

Page 60: IMS DC Self Study Complete Tutorial

IMS DC Slide: 60

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

Page 61: IMS DC Self Study Complete Tutorial

IMS DC Slide: 61

• Format of the ISRT call with the MOD name segmentCALL ‘CBLTDLI’ USING DLI-ISRT

IO-PCB-MASKOUTPUT-MESSAGE-IO-AREAMFS-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 tocause an input message that begins with:/format mod-name

Page 62: IMS DC Self Study Complete Tutorial

Screen Example

IMS DC Slide: 62

• Receivables Menu Date: xxxxxxx

PF1 Enter Cash ReceiptsPF2 Display Invoice Summary

Page 63: IMS DC Self Study Complete Tutorial

Format Set for Menu Program

IMS DC Slide: 63

• MENUDF FMTDEV TYPE=(3270,2),FEAT=IGNORE,SYSMSG=ERRMSG,

PFK=(PFKFIELD,’/FOR CRO ‘,’/FOR DI2O ‘,’/FOR DIDSO’)DIV TYPE=INPUTDFLD ‘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=MENUOSEGMFLD PFKFIELD,LTH=10MSGEND

MENUO MSG TYPE=OUT,SOR=(MENUDF,IGNORE),NXT=MENUISEGMFLD (CURDATE,DATE2)MFLD LTH=1MSGEND

Page 64: IMS DC Self Study Complete Tutorial

IMS DC Slide: 64

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

Page 65: IMS DC Self Study Complete Tutorial

Identifying the Output Message Fields

IMS DC Slide: 65

• 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. (LowValues)

Page 66: IMS DC Self Study Complete Tutorial

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

Page 67: IMS DC Self Study Complete Tutorial

Cursor & Attribute ControlFirst byte (Cursor Control) Second Byte (Attribute Control)

0 0 0 0 0 0 1 0Bit 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

CursorPositioning

Shift Intensity Pen MDT

ProtectionAttribute Override

Byte

Bits Function Values

1 0-1 Cursor Pos. 00 Cursor Positioning not requested11 Position cursor at this field. (Values 01 and 10 are invalid)

2-7 000000 (Always)2 0 1 (Always)

1 AttributeOverride Type

0 Use the attr. Specifications that follow to activate only specifiedattributes (that is attributes whose corresponding override bit is on

1 Use the attribute specs that follow to replace all device field attribu2 Protect. Attr. 0 Unprotected

1 Protected3 Shift Attribute 0 Alphanumeric Shift

1 Numeric Shift4-5 Intensity Attrib 00 Normal Intensity

01 No-display10 Bright Intensity11 Bright Intensity

6 Light-pen Attr 0 Should be 0 for non- Light – Pen applications7 MDT 0 MDT off

1 MDT on

IMS DC Slide: 67

Page 68: IMS DC Self Study Complete Tutorial

Control the cursor

IMS DC Slide: 68

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

• Field Oriented CursorTo 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.

Page 69: IMS DC Self Study Complete Tutorial

Absolute Cursor Control

IMS DC Slide: 69

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

Page 70: IMS DC Self Study Complete Tutorial

IMS DC Slide: 70

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

Page 71: IMS DC Self Study Complete Tutorial

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)

• Operator Physical Paging: Program Function keys could be used.

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

Page 72: IMS DC Self Study Complete Tutorial

Multiple Physical Page Input

IMS DC Slide: 72

• MFS provides a facility to generate a single physical input message from multiple physical pages.DPAGE StmtMULT=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

Page 73: IMS DC Self Study Complete Tutorial

Logical Paging

IMS DC Slide: 73

• 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

Page 74: IMS DC Self Study Complete Tutorial

Operator Logical Paging Commands

IMS DC Slide: 74

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

Page 75: IMS DC Self Study Complete Tutorial

How to define message pages

IMS DC Slide: 75

• 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

Page 76: IMS DC Self Study Complete Tutorial

How to support operator logical paging

IMS DC Slide: 76

• Enable Operator logical pagingPAGE = 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)

SEGMFLD PAGECMD,LTH=5,

Page 77: IMS DC Self Study Complete Tutorial

IMS DC Slide: 77

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

Page 78: IMS DC Self Study Complete Tutorial

IMS DC Slide: 78

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

ApplicationProgram

DataBase

Terminal

Printer

Input Message

Output Message(IOPCB)

Output Message

(ALTPCB)

Page 79: IMS DC Self Study Complete Tutorial

IMS DC Slide: 79

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

Page 80: IMS DC Self Study Complete Tutorial

IMS DC Slide: 80

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

Page 81: IMS DC Self Study Complete Tutorial

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.

Page 82: IMS DC Self Study Complete Tutorial

IMS DC Slide: 82

• 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 IMSuses to keep track of SPA.

Page 83: IMS DC Self Study Complete Tutorial

IMS DC Slide: 83

• 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-GUIO-PCB-MASKSPA-IO-AREA.

Page 84: IMS DC Self Study Complete Tutorial

IMS DC Slide: 84

– To save Data in the SPA, an ISRT call is issued against I/O PCB.

CALL ‘CBLTDLI’ USING DLI-ISRTIO-PCB-MASKSPA-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.

Page 85: IMS DC Self Study Complete Tutorial

IMS DC Slide: 85

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

Page 86: IMS DC Self Study Complete Tutorial

• Immediate Program Switching :

Application Program - 1

Application Program - 2

Terminal

Output Message

Input Message

SPA

Switch Message Segment

IMS DC Slide: 86

Page 87: IMS DC Self Study Complete Tutorial

IMS DC Slide: 87

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

Page 88: IMS DC Self Study Complete Tutorial

• Deferred Program Switching :

Application Program - 1

Application Program - 2

Terminal

Output Message 2

Input Message 1

SPAOutput Message 1

Input Message 2

IMS DC Slide: 88

Page 89: IMS DC Self Study Complete Tutorial

IMS DC Slide: 89

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

Page 90: IMS DC Self Study Complete Tutorial

IMS DC Slide: 90

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

Page 91: IMS DC Self Study Complete Tutorial

IMS DC Slide: 91

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

Page 92: IMS DC Self Study Complete Tutorial

IMS DC Slide: 92

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

Page 93: IMS DC Self Study Complete Tutorial

IMS DC Slide: 93

• 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-CHKPIO-PCB-MASKINPUT-MESG-IO-AREA.

Page 94: IMS DC Self Study Complete Tutorial

Thank You

IMS DC Slide: 94