Anda di halaman 1dari 147

IMS Transaction Manager

Kamakshigari Suresh
TSPL

IMS Transaction Manager

Agenda

IMS Overview
IMS TM Architecture
Message Format Services
COBOL Programming for IMS DC
Conversational Programming

IMS Overview

IMS Overview

Product Features

A mature product from IBM


Over 40 years in the market
Most critical corporate data under IMS
Two separate strategic products
IMS DB Manager
IMS Transaction Manager

IMS Overview

IMS Components

Primary Products
IMS/DB - Database management, logging & recovery
IMS/TM - Interactive online functions, transaction driven
Product Implementations
DBCTL
DCCTL
DB/DC

IMS Overview

IMS Dependent Regions


DL/I Region

MPP Regions

BMP Regions

IMS Overview

IMS Batch Environment


Execution via JCL.
Each job in an address space.
Programs address space contains a copy of DL/I modules.
Programs added without having to modify the IMS system definition.

IMS Overview

IMS On-line Environment


High volume, rapid response transaction processing.
DBCTL or DCCTL.
IMS is a started task of MVS.
IMS system definition must include information about all programs and
resources under the control of IMS.

IMS Overview

IMS On-line Environment


IMS handles information in the form of messages that flow
between terminals and application programs.
DL/I modules reside either in the control region or in a separate
address space called DLISAS.
Hence DL/I services are centralized and can be shared by all
dependent regions.

IMS Overview

Functions of TM
Provides users with online
access to applications
Processes high volume of
online transactions
Provides rapid response
time for application
programs
Defines a logical and
physical terminal structure
Supports database
management integration

IMS Overview

IMS TM
Communication Modules
Terminal

Message Queues

QPOOL
Message
Overflow
Dataset

Queue
Management
Modules

Terminal
DL/I Modules
DC Calls

DB Calls

Application Program

Databases

IMS Overview

Message Processing Regions (MPRs)


Process on-line transactions from terminals.
Application programs are automatically scheduled by IMS as a result of data coming
into the system from terminals.

IMS Overview

Batch Message Processing (BMP) Regions

Region starts when job submitted by operator.


BMP programs access IMS message queues and on-line databases.

IMS Overview

IMS Environments
/DIS A

IMS Overview

IMS Environments
SDSF Spool

IMS TM Architecture

IMS TM Architecture

IMS TM Architecture
Address Spaces
IMSGEN
Terminals
Master Terminal Operator (MTO)
Message Types
Message Queuing
IMS Security

IMS TM Architecture

Address Spaces

IMS TM Architecture

IMSGEN
Used to build the IMS resources
Uses series of user customized macros
Macros can be
System Macros
Application Macros
Terminal Network Macros

IMS TM Architecture

IMSGEN
System Macros
IMSCTRL

Defines IMS System Parameters

IMSCTF

Defines IMS and DBCTL Parameters

MSGQUEUE Defines the Message Queues


BUFPOOLS

Defines the control block buffer pools

IMS TM Architecture

IMSGEN
Application Macros
DATABSE

Defines Databases

APPLCTN

Defines Application Programs

TRANSACT

Defines transactions and its parameters

IMS TM Architecture

IMSGEN
Terminal Network Macros
COMM

Defines Communication Defaults

TERMINAL

Defines Physical Terminals

NAME

Defines Logical Terminals

IMS TM Architecture

Terminal Definition
Terminal Definition
PTERM
LTERM

Logical Terminal Types


Static Terminal
Dynamic Terminal

IMS TM Architecture

Static Terminal
Predefined in IMSGEN

IMS TM Architecture

Dynamic Terminal
Prompts the user to sign on
LTERM is created dynamically
Uses installation rules to create LETRM
Helps to reduce the size of IMSGEN

IMS TM Architecture

Master Terminal Operator


Manages the over all TM environment
Supports commands to modify the status and characteristics of TM
components

IMS TM Architecture

Master Terminal Operator

Manages and controls


User-Terminal
Network
Message Scheduling
Environment
System Control
Activities

IMS TM Architecture

Message Types
Transactions
Message Switches
Commands

IMS TM Architecture

Transactions

IMS TM Architecture

Transactions
Transaction Consists of
Transaction Code
Password
A blank Space
Message Text

IMS TM Architecture

Message Switches
Manages Messages
Allows terminals to communicate with each other

IMS TM Architecture

Message Switches
Message Switch consists of
LTERM Name
Password
A blank space
Message Text

IMS TM Architecture

Commands
Controls IMS Operations
Originated from user terminal or application program

IMS TM Architecture

Commands
A Command consists of
A forward slash (/)
Command verb
Password
A blank space
Command Keyword

IMS TM Architecture

Commands

IMS TM Architecture

Message Queuing
Message Queues are used to
Route I/P message to Application Programs
Route O/P message to Terminal

IMS TM Architecture

Message Queuing

IMS TM Architecture

Message Queuing
Functions of Message Queues
Processing transactions
Storing and prioritizing messages
Maintaining message queue buffers
Processing multiple message queues

IMS TM Architecture

Message Queuing

IMS TM Architecture

IMS Security
Security Maintenance Utility (SMU)
Resource Access Control Facility (RACF)

IMS TM Architecture

SMU
A Security feature specific to IMS
Defines control statements to protect IMS resources

IMS TM Architecture

RACF
An independent facility
Authentication using passwords

IMS TM Architecture

APPLCTN Macro
Defines Program Resource Requirements
One APPLCTN macro is combined with one or more TRANSACT macros
- Syntax
APPLCTN FPATH=_ _ _, LANG=_ _ _, PSB=_ _ _, PGMTYPE=_ _ _,
SCHDTYP=_ _ _
- Values
FPATH
LANG
PSB
PGMTYP
SCHDTYP

--- yes/no
--- Language Type
--- PSB to be used
--- TP / Batch
--- Parallel / Serial

IMS TM Architecture

TRANSACT Macro
Specifies the transaction codes that cause the application program
named in the preceding APPLCTN macro
Defines various transaction parameters
- Syntax
TRANSACT CODE=<transaction code>,FPATH=<yes/no>,
Inquiry=<yes/no>,MSGTYP=<snglseg/multseg>,
PRTY=(<normal>,<current>,<limit>),
SERIAL=<yes/no),MAXRGN=<number>

Message Format Service

Message Format Service

MFS
An IMS/TM facility
Defines a screen and its variables
Formats messages transmitted to and from display screens.

Message Format Service

Message Flow using MFS

Message Format Service

Functions of MFS

Simplifies message handling


Makes applications device independent
Provides full paging capability
Formats messages using Control Blocks

Message Format Service

Simplifies message handling

Message Format Service

Makes applications device independent

Message Format Service

Provides full paging capability

Message Format Service

Formats messages using Control Blocks

Message Format Service

MFS Control Blocks


Message Input Descriptor

MID

Message Output Descriptor

MOD

Device Input Format

DIF

Device Output Format

DOF

Message Format Service

Information Flow

DIF

MID

Q
U

SC
R

E
U

DOF

MOD

Program

Message Format Service

MFS Control Statements


Device Format Control Statements
Message Descriptor Control Statements
Compilation Control Statements

Message Format Service

MFS Control Statements

18

10 14

16 71

72

Label

Operati
on

Operand / Comment

Continuation
Character

Message Format Service

Device Format Statements


FMT

DEV

DIV

DPAGE

DFLD

..

DFLD

DPAGE

DFLD

..

DFLD

DEV

DIV

DPAGE

DFLD

..

DFLD
FMTEND

Message Format Service

DEV Statement
DEV

TYPE=(3270,1)

,FEAT=IGNORE

[,PFK=(pfkeyfeild, [integer=] literal]


NEXTPP
NEXTMSGP
NEXTLP
ENDMPPI

[,DSCA=Xnnnn]

[,SYSMSG=msgfield]

Message Format Service

DEV Statement
PFK Keyword
PFK=(PFKTEXT,1=01,2=02, 3=03,10=10)
PFK=(PFKTEXT,01,02, 03,,,,,,,10)
PFK=(PFKTEXT,1=01,2=02, 3=03,4=NEXTPP,5=NEXTLP,10=10)

Message Format Service

DIV Statement
DIV

TYPE=INOUT

Message Format Service

DPAGE Statement
label

DPAGE

CURSOR=(line,column)/fieldname,
FILL=fillchar
MULT=YES

Message Format Service

DFLD Statement
label

DFLD

literal,
POS=(line,column),
LTH=length of field,
ATTR=(attribute1,attribute2, attribute3,attribute4),
EATTR=(e-attribute1,e-attribute2)

Message Format Service

DFLD Statement
ATTR keyword
Attribute1

ALPHA / NUM

Attribute2

PROT / NOPROT

Attribute3

NORM / NODISP / HI

Attribute4

NOMOD / MOD

Message Format Service

DFLD Statement
EATTR keyword
EAttribute1

HD / BLINK / HREV / HUL

EAttribute2

CD / BLUE / RED / PINK / GREEN / TURQ / YELLOW/ NEUTRAL

Message Format Service

DFLD Statement - Examples


DFLD PURCHASE ORDER INFORMATION SYSTEM,

POS=(1,7),

LTH=33,

ATTR=(ALPHA,PROT,HI),

EATTR=(HUL,BLUE)

ORDERNO DFLD POS=(3,5),

LTH=10,

ATTR=(NUM,NOPROT,HI,MOD) ,

EATTR=(HD,YELLOW)

Message Format Service

EQU Statements
APH

EQU

ATTR=(PROT,HI)

TOTAL1 DFLD

POS=(3,10),LTH=8,APH

Message Format Service

DO Statements

DO Statement is used for looping the repeated field patterns


DO

12

PDATE

DFLD

POS=(6,2),LTH=8,ATTR=(PROT,ALPHA,NORM,NOMOD)

PBNKNO

DFLD

POS=(6,12),LTH=25,ATTR=(PROT,ALPHA,NORM,NOMOD)

PCHKNO

DFLD

POS=(6,38),LTH=16,ATTR=(PROT,ALPHA,NORM,NOMOD)

PAMT

DFLD

POS=(6,55),LTH=9,ATTR=(PROT,ALPHA,NORM,NOMOD)

ENDDO

Message Format Service

Device Format Statements - Exercise

Message Format Service

Device Format Statements - Exercise


P030MD FMT
DEV TYPE=(3270,2),
FEAT=IGNORE,
SYSMSG=SYSMSG,
PFK=(PFKEY,01='M28H900T HELP ,05=P0300M0T CONT ,
11= 'P0300M0T MENU ')
DIV TYPE=INOUT
DPAGE CURSOR=((03,08,CURPOS)),FILL=PT
*

Message Format Service

Device Format Statements - Exercise


DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD

'PHF - P0300M0T',POS=(01,02),ATTR=PROT
'PO REQUISITION ',POS=(01,36), ATTR=PROT
'RETURNED REQUISITIONS',POS=(02,33), ATTR=PROT
'LOC (',POS=(03,02), ATTR=PROT
')',POS=(03,13), ATTR=PROT
'PLANT (',POS=(03,16), ATTR=PROT
')',POS=(03,27), ATTR=PROT
'OR REQ # (',POS=(03,30), ATTR=PROT
')',POS=(03,54), ATTR=PROT
'OPT REQUISITION DATE
ISSUED BY',POS=(05,03),
ATTR=PROT
'DATE
BUYER',POS=(05,51), ATTR=PROT
'NUMBER
ISSUED',POS=(06,09), ATTR=PROT
'REQUIRED',POS=(06,49), ATTR=PROT

Message Format Service

Device Format Statements - Exercise


DO
DFLD
DFLD
ENDDO
DFLD
DFLD
DFLD
DFLD
DFLD

12
'(',POS=(07,02),ATTR=PROT
')',POS=(07,06),ATTR=PROT
'OPTIONS: X=ALL B=BASIC C=COMMENTS I=ITEM',
POS=(21,02),ATTR=PROT,HI
'D=DELIVERY H=CHARGE',
POS=(21,53),ATTR=PROT,HI
'R=RETURN TO BUYER M=SUPPLIER',
POS=(22,11),ATTR=PROT,HI
'T=DECODER V=CODE CATLG',POS=(22,44),ATTR=PROT,HI
'PF1=HELP
PF5=CONT
PF11=MENU ',
POS=(23,20),ATTR=PROT

Message Format Service

Device Format Statements - Exercise


SYSMSG
DATE2
TIME
LTNAME
LOCORIG
PLANTCD
REQNUM

DFLD POS=(24,01),LTH=77,ATTR=HI
DFLD POS=(01,55),LTH=08,ATTR=PROT
DFLD POS=(01,64),LTH=05,ATTR=PROT
DFLD POS=(01,73),LTH=08,ATTR=PROT
DFLD POS=(03,08),LTH=04,ATTR=MOD
DFLD POS=(03,24),LTH=02,ATTR=MOD
DFLD POS=(03,42),LTH=11,ATTR=MOD
DO 12
OPT
DFLD POS=(08,04),LTH=01,ATTR=MOD
REQNUM DFLD POS=(08,08),LTH=11,ATTR=PROT,MOD
ISDDAT DFLD POS=(08,21),LTH=08,ATTR=PROT
ISDNAM DFLD POS=(08,31),LTH=15,ATTR=PROT
DATREQ DFLD POS=(08,49),LTH=08,ATTR=PROT
BUYER
DFLD POS=(08,59),LTH=20,ATTR=PROT
ENDDO
FMTEND

Message Format Service

Message Descriptor Statements


MSG

LPAGE

SEG

MFLD

..

MFLD

SEG

MFLD

..

MFLD
LPAGE

SEG

MFLD

..

MFLD
MSGEND

Message Format Service

MSG Statement
Msgname MSG

TYPE=INPUT/OUTPUT,
SOR=(dpagename,IGNORE),
NXT=next message name,
PAGE=YES

X
X
X

Message Format Service

LPAGE Statement
MOD set counter part of DPAGE
Used for Paging of Screens
Can have multiple LPAGEs subordinate to a MSG statement

Message Format Service

MFLD Statement
MFLD

literal/DFLD name,
LTH=length,

X
X

Message Format Service

MFLD Statement - Examples


MFLD

Hi Program,
LTH=10

MFLD

ORDERNO,
LTH=10

MFLD

(ORDERNO,1111111111),
LTH=10

Message Format Service

Message Format Statements - Exercise

Message Format Service

Message Descriptor Statements - Exercise


MID
PMHF

MSG

TYPE=INPUT,
SOR=(P030MD,IGNORE),
NXT=PHF

SEG
MFLD (PFKEY,'P0300M0T @ '),LTH=14
MFLD LOCORIG,LTH=04
MFLD PLANTCD,LTH=02
MFLD REQNUM,LTH=11
MFLD CURPOS,LTH=04
DOLBLI
DO 12
MFLD OPT,LTH=01
MFLD REQNUM,LTH=11
MFLD (ISDDAT,'@'),LTH=08
MFLD (ISDNAM,'@'),LTH=15
MFLD (DATREQ,'@'),LTH=08
MFLD (BUYER,'@'),LTH=20
ENDOLBLI ENDDO
MSGEND

X
X

Message Format Service

Message Descriptor Statements - Exercise


MOD
PHF

MSG TYPE=OUTPUT,
SOR=(P030MD,IGNORE),
NXT=PMHF
SEG
MFLD (DATE2,DATE2)
MFLD (TIME,TIME)
MFLD (LTNAME,LTNAME)
MFLD SYSMSG,LTH=77
MFLD CURPOS,LTH=04
DOLBLM
DO 12
MFLD OPT,LTH=01
MFLD REQNUM,LTH=11
MFLD ISDDAT,LTH=08
MFLD ISDNAM,LTH=15
MFLD DATREQ,LTH=08
MFLD BUYER,LTH=20
ENDOLBLM ENDDO
MSGEND
END

X
X

IMS DC Application
Programming

IMS DC Application Programming

IMS Transaction Flow


Sequence of Events :
Message Input
Message Retrieval
Message Processing
Message Output

IMS DC Application Programming

Message Input
Originates at a terminal.
Stored in the appropriate message queue.
A group of message segments making up a message is transmitted at one
time.

IMS DC Application Programming

IMS Transaction Flow

IMS DC Application Programming

Message Selection

IMS TM selects messages from the message queue.


IMS then schedules the associated MPP for loading into an available MPP
processing region.

IMS DC Application Programming

Message Processing

MPP retrieves message segments one at a time, using GU and GN calls.

(2)

(2)

LENGTH

ZZ
Field

(8)

Trans Name

MESSAGE TEXT

IMS DC Application Programming

Message Output

MPP issues ISRT calls to send messages back to the originating terminal.
These output messages are stored in the message queue sequenced by the
destination name.

IMS DC Application Programming

DL/I Calls

For retrieving messages :


GU
GN

IMS DC Application Programming

DL/I Calls

01

INPUT-MESSAGE-AREA.
05 INPUT-LL-FILED
05 INPUT-ZZ-FILED
05 INPUT-TRAN-CODE
05 INPUT-MESSAGE-DATA
10 INPUT-PART-NO
10 INPUT-ASSEMBLY-NO
10 INPUT-PART-NAME
10 FILLER

PIC
PIC
PIC
PIC
PIC
PIC
PIC

S9(4) COMP.
S9(4) COMP.
X(8).
X(10).
X(12).
X(20).
X(100).

IMS DC Application Programming

DL/I Calls

CALL CBLTDLI

USING GU
IO-PCB-MASK
INPUT-MESSAGE-AREA.

IF IO-PCB-STATUS-CODE = QC
MOVE Y

TO

ELSE
CONTINUE
(PROCESS THE MESSAGE)

WS-NO-MORE-MESSAGE

IMS DC Application Programming

DL/I Calls

CALL CBLTDLI

USING GN
IO-PCB-MASK
INPUT-MESSAGE-AREA.

IF IO-PCB-STATUS-CODE = QD
MOVE Y

TO

ELSE
CONTINUE.
(PROCESS THE MESSAGE)

WS-NO-MORE-MESSAGE

IMS DC Application Programming

I-O PCB Mask


IO-PCB-LOGICAL-TERMINAL

PIC X(8).

FILLER

PIC XX.

IO-PCB-STATUS-CODE

PIC XX.

IO-PCB-DATE

PIC S9(7)

COMP-3.

IO-PCB-TIME

PIC S9(6)V9

COMP-3.

IO-PCB-MSG-SEQ-NUMBER

PIC S9(5)

COMP.

IO-PCB-MOD-NAME

PIC X(8).

IO-PCB-USERID

PIC X(8).

IMS DC Application Programming

DL/I Calls - contd.

For sending messages :


ISRT
CHNG
PURGE

IMS DC Application Programming

DL/I Calls - contd.


01 OUTPUT-MESSAGE-AREA.
05 OUTPUT-LL-FILED

PIC S9(4) COMP.

05 OUTPUT-ZZ-FILED

PIC S9(4) COMP.

05 OUTPUT-PART-NO

PIC X(10).

05 OUTPUT-ASSEMBLY-NO

PIC X(12).

05 OUTPUT-PART-NAME

PIC X(20).

05 OUTPUT-VENDOT-CODE

PIC X(05).

05 OUTPUT-STAMPETR-CODE PIC X(08).

01 WS-MOD-NAME

PIC X(08)
VALUE PARTSCRN .

IMS DC Application Programming

DL/I Calls - contd.

MOVE LENGTH OF OUTPUT-MESSAGE-AREA


TO OUTPUT-LL-FIELD

CALL CBLTDLI

USING ISRT
IO-PCB-MASK
OUTPUT-MESSAGE-AREA
WS-MOD-NAME.

IMS DC Application Programming

Program Communication Block


Calls for retrieving input messages and inserting output messages
must reference an IOPCB.
IO-PCB : first PCB listed on the ENTRY statement.
Messages can be routed to other destinations using ALT-PCB.

IMS DC Application Programming

Alternate PCBs

To send messages to several alternate destinations, all via the same ALT-PCB.
PSB
PCB

TYPE=TP,LTERM=M3270,ALTRESP=YES,EXPRESS=YES

PCB

TYPE=TP,MODIFY=YES,EXPRESS=YES

IMS DC Application Programming

ALT-PCB Masks

01

ALT-PCB-MASK.
05 ALT-PCB-DESTINATION

PIC

X(8).

05 FILLER

PIC

XX.

05 ALT-PCB-STATUS-CODE

PIC

XX.

IMS DC Application Programming

Routing O/P to Alternate Destination


CALL CBLTDLI USING

CHNG

ALT-PCB-MASK
WS-DESTINATION-NAME.

CALL CBLTDLI USING

ISRT

ALT-PCB-MASK
MESSAGE-IO-AREA.

CALL CBLTDLI USING


ALT-PCB-MASK.

PURG

IMS DC Application Programming

Multiple Alternate Destinations

MOVE new-dest-name
CHNG
ISRT
PURG

MOVE new-dest-name
CHNG
ISRT
PURG

-------- -------- ---------

Message Format Service

Dynamic Controlling Field Attributes

Define the fields in DIF/DOF with a label


Include the field label in MID/MOD with operand ATTR=YES
Length of the MFLD should be equal to length of DFLD + 2
Code the program to pass correct control information to MFS

Message Format Service

Identifying Fields
ATTR = YES in MFLD statement.
First two bytes contain control information.
User data starts in third byte.

Message Format Service

First Byte

For controlling field oriented cursor positioning.


X00 no cursor positioning required on this field.
XC0 cursor should be positioned on this field.

Message Format Service

Second Byte

For controlling attributes.


0
1
Always

1
Attrib.
Overrid
e

2
PROT

3
NUM

4
HI

5
NO
DISP

6
Light
Pen
Attrib.

7
MDT

Message Format Service

Attribute Handling in Programs

A two byte prefix should be included for each of the fields having ATTR=YES in
MFS.
Appropriate control bit combinations should be moved to the second byte of the
prefix.

Message Format Service

Dynamic Attribute Handling - Example

DIF/DOF
CUSTID

DFLD

POS=(5,15),ATTR=HI,LTH=10

MFLD

CUSTID,ATTR=YES,LTH=12

MFLD

CUSTID,ATTR=YES,LTH=12

MOD

MID

Message Format Service

Dynamic Attribute Handling - Example

PROGRAM
WS
01 INPUT-OUTPUT-AREA.
-----------------05

CUSTOMER-ID-INFO.
10 CUSTOMER-ID-ATTR

PIC X(02).

10 CUSTOMER-ID-DATA

PIC X(10).

----------------- PD
MOVE value

TO

CUSTOMER-ID-ATTR.

Message Format Service

Cursor Control
Default Cursor Positioning
Dynamic Cursor Positioning
Field Oriented Cursor Control
Absolute Cursor Control

Message Format Service

Default Cursor Positioning


By coding CURSOR Parameter on DPAGE statement
DPAGE CURSOR=((3,17))

Message Format Service

Field Oriented Cursor Control


Should have
ATTR=YES

Code the program to pass correct control information to MFS.

Conversational
Programming

Conversational Programming

Program-to-Program Message Switch

Immediate Message Switch


Program that receives the input message is not the same one
that responds to the terminal.

Deferred Message Switch


A single conversation involves more than one application
program, one for each terminal interaction.

Conversational Programming

Immediate Message Switch

Program 1

Input
Terminal

Message

SPA

Output
Program 2

Conversational Programming

Deferred Message Switch

Input 1

Program 1
Output 1

Terminal

SPA
Input 2

Output 2

Program 2

Conversational Programming

Conversational Transactions

There are three different ways to store data


On the Terminal Screen
In a Database
In SPA
The ending of a conversation should be handled by the program.

Conversational Programming

Storing Data on Screens

Store data in Protected, Hidden fields with MDTs ON.


For small amounts of non-critical data only.

Conversational Programming

Storing Data in a Database


For large amounts of data.
Database accesses are expensive.
Standardization required.

Conversational Programming

Scratch Pad Area

An IMS facility for terminal interactions


SPA is a work area to retain information from an application program
A unique SPA for each physical terminal

Conversational Programming

SPA-IO-AREA

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

PIC X(8),

05 SPA-USER-DATA

PIC X().

Conversational Programming

SPA

In a conversational program, the SPA must be retrieved before the message


segments are retrieved.
Then to retrieve the first segment of the input message issue a GN call.

Conversational Programming

Program Not Using SPA


Read input message ( GU + GNs )
Process Message
Insert output message ( ISRT )

Conversational Programming

Program Using SPA


Read SPA ( GU )
Read input message ( GNs )
Process Message
Insert SPA ( ISRT )
Insert output message ( ISRT )

Conversational Programming

Program Using SPA


CALL CBLTDLI USING

GU ,
IO-PCB-MASK,
SPA-IO-AREA.

CALL CBLTDLI USING

GN ,
IO-PCB-MASK,
INPUT-MESSAGE-AREA.
-

CALL CBLTDLI USING

ISRT ,
IO-PCB-MASK,
SPA-IO-AREA.

CALL CBLTDLI USING

ISRT ,
IO-PCB-MASK,
OUTPUT-MESSAGE-AREA
WS-MOD-NAME.

Advanced DC
Programming

Advanced DC Programming

Logging in IMS DC
OLDS
OLDS
OLDS

DBRC RECON

Logging

Log
Archive
Utility

WADS

IMS/VS
RDS

SLDS

RLDS

Advanced DC Programming

Logging in IMS DC
In the on-line environment,system log data sets are also part of
logging system.
There are several on-line log data sets, IMS uses one after another
when one fills up with log records
The main kind of log file in the DC environment is called as On-Line
Log Datasets (OLDS).
IMS uses a file called as Write-Ahead Dataset (WADS) to record log
data temporarily that will be eventually stored in an OLDS.
The WADS enables IMS to write OLDS only when enough log data
has been accumulated to fill a block, at the same time not losing any
data in event of failure

Advanced DC Programming

Logging in IMS DC

DBRC RECON data set, identifies each OLDS and indicates whether
its currently in use,is available for use,or is full of log data that should be
archived.
Once the OLDS gets filled, its contents are copied by IMS Log Archive
Utility to an SLDS(system log data sets).
In addition the utility copies the OLDS records to another log file called
as Record Log Dataset (RLDS) used in database recovery.
IMS uses data sets to enable it to recover from its own errors. When
IMS restarts it stores information into a log file called the Restart
Dataset (RDS)

Advanced DC Programming

Error Handling in MPP

A DC call (LOG call) can be issued for recording the information


about a program error.

CALL CBLTDLI USING LOG


IO-PCB-MASK
LOG-USR-DATA.

Advanced DC Programming

Error Handling in MPP

IMS default automatic recovery feature, reverses the changes the program
has made.
An alternative approach is to use ROLL or ROLB call to roll back the
changes to the last sync point.
Both the calls causes the data base updates made since last checkpoint to
be reversed and cancels output messages inserted then.

Advanced DC Programming

Error Handling in MPP


CALL CBLTDLI USING ROLL.

IMS terminates the program and disables it from being automatically


scheduled again.

After a program has issued the ROLL call, the system operator has to
enable it explicitly before IMS will schedule it again.

The input message that was being processed when the call was issued
is deleted.

Advanced DC Programming

Error Handling in MPP


The ROLB call does not cause the program to be terminated, the
program can continue to process other messages that are present in its
queue.
CALL CBLTDLI USING ROLB
IO-PCB-MASK
INPUT-MSG-AREA.
The ROLB call can be used only in the programs that are specified to
IMS to run in single processing mode.

Advanced DC Programming

Error Handling in MPP

The input message that was being processed may or may not be
deleted depending on the format of the call.
The input message thats currently processed is presented to the
program in the specified I/O area in the call.
If the ROLB call is issued without the I/O area the input message is
likely to be deleted.

Advanced DC Programming

Paging
The facility that lets the messages be broken down into components for
display, or for processing, or for both.
Required when long and complex output messages are created.
MFS provides two kinds of paging
Physical
Logical paging.

Advanced DC Programming

Physical Paging
A message with a fixed number of segments is further subdivided into parts
that are sized properly for a particular device.
The screen layout is defined in three dimensional way
Label

DFLD [literal],POS=(line,column,page),ATTR=(--,--,--)

Advanced DC Programming

Physical Paging
Example:
An application is designed to send an output message that fills a
standard size 3270 model 2 (24,80) and some of the users use a
3270 model 1 display stations(12 lines)

DFLD for 24-line


TYPE=(3270,2)
FIELD1
FIELD2
FIELD3
FIELD4
FIELD5
FIELD6
FIELD7

DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD

DFLD for 12-line


TYPE=(3270,1)
POS=(3,12)
POS=(6,12)
POS=(9,12)
POS=(10,12)
POS=(15,12)
POS=(18,12)
POS=(21,12)

FIELD1
FIELD2
FIELD3
FIELD4
FIELD5
FIELD6
FIELD7

DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD

POS=(3,12,1)
POS=(6,12,1)
POS=(9,12,1)
POS=(10,12,1)
POS=(3,12,2)
POS=(6,12,2)
POS=(9,12,2)

Advanced DC Programming

Physical Paging
When an output message consists of multiple physical pages, MFS sends
the first physical page first.
The next page can be requested by an appropriate function key.
The PF keys are enabled by coding the PFK parameter of the DEV
statement.
There may be only one DPAGE control statement, but the firlds would be
defined in 3 dimensional layout

Advanced DC Programming

Physical Paging
PPAGEX

FMT
DEV

FIELD1
FIELD2
-

FIELD3
FIELD4
-

DIV
DPAGE
DFLD
DFLD
DFLD
DFLD
DFLD
DFLD
FMTEND

TYPE=(3270,2),
FEAT=IGNORE,
PFK=(PFKTEXT,5=NEXTPP,3=ENDMPPI)
TYPE=INOUT
CURSOR = ((3,12),(3,15)),MULT=YES
PAGE 1 OF 2,POS=(1,25,1),ATTR=PROT,HI
POS=(2,15,1),LTH=10,ATTR=MOD
POS=(4,15,1),LTH=8,ATTR=MOD
PAGE 2 OF 2,POS=(1,25,2),ATTR=PROT,HI
POS=(2,15,2),LTH=15,ATTR=MOD
POS=(4,15,2),LTH=30,ATTR=MOD
-

X
X

Advanced DC Programming

Logical Paging
A logical page is associated with a single screen image with multiple
occurrences of the same screen
The pages could be with different data and different layout, as part of the
output message.
Logical paging is often used for applications that produce relatively large
amounts of output.

Advanced DC Programming

Logical Paging
A logical page is simply a group of related fields,either on the terminal
screen or in a message.
A group of fields as seen on a device is a device page.
The data thats received from or sent to a device page by an application
program is called a message page.
There would be multiple DPAGE and LAPGE statements and each LPAGE
would be mapped to a corresponding DPAGE
The Logical Field display is controlled by a logical page identifier field

Advanced DC Programming

Logical Paging
MOD
MODNAME

LPAGENM

MSG

LPAGE

TYPE=OUTPUT,SOR=(DIFDOF,IGNORE),
PAGE=YES

SOR=DPAGENM,
COND=(MFLDNANE,

<
>
=
<=
=>

X
, comparison )
value

Advanced DC Programming

Logical Paging
LPAGEX

FMT
DEV

DAPGE1
FIELD1
FIELD2
DAPGE2
FIELD3
FIELD4
-

DIV
DPAGE
DFLD
DFLD
DFLD
DPAGE
DFLD
DFLD
DFLD
FMTEND

TYPE=(3270,2), FEAT=IGNORE,
PFK=(PFKTEXT,5=NEXTLP,3=ENDMPPI)
TYPE=INOUT
CURSOR = ((3,12))
FIRST LOGICAL PAGE,POS=(1,25),ATTR=(PROT,HI)
POS=(2,15),LTH=10,ATTR=MOD
POS=(4,15),LTH=8,ATTR=MOD
CURSOR = ((4,25))
SECOND LOGICAL PAGE,POS=(1,25),ATTR=(PROT,HI)
POS=(2,15),LTH=15,ATTR=MOD
POS=(4,15),LTH=20,ATTR=MOD
-

Advanced DC Programming

Logical Paging
LPAGEMODE

MSG

LPAGE1

LPAGE
SEG
MFLD
MFLD
MFLD
LPAGE
SEG

LPAGEID

LPAGE2
LPAGEID

TYPE=OUTPUT,SOR=(LAPGEX,IGNORE),
NEXT=LPAGEMID,PAGE=YES
SOR=DPAGE1,COND=(LPAGEID,=,1)
LTH=1
FIELD1,LTH=10
FIELD2,LTH=8
SOR=DPAGE2,COND=(LPAGEID,=,2)

MFLD
LTH=1
MFLD
FIELD3,LTH=15
MFLD
FIELD4,LTH=20
MSGEND
END

Advanced DC Programming

Logical Paging
Command

Action

Move forward one logical page

-1

Move back to the previous 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

Advanced DC Programming

Scroll Down Scroll Up logic using Logical Paging


CALL CBLTDLI GU
IO-PCB-MASK
INPUT-AREA

RETRIEVE REPORT OUTPUT


FROM DATABASE / TABLE &
POPULATE IN OUTPUT-AREA.
COUNT THE NUMBER OF REC

NO

IS RECORD
COUNT = SCREEN
LINE LIMIT?

YES

SPACE OUT OUTPUT-AREA


SE THE RECORD COUNTER
TO ZERO

CALL CBLTDLI ISRT


IO-PCB-MASK
OUTPUT-AREA
WS-MOD-NAME

Advanced DC Programming

Scroll Down Scroll Up logic using Logical Paging


LPAGEX

FMT
DEV
DIV
DPAGE
DFLD

DAPGE1
FIELD1
FIELD2
FIELD3
FIELD4
-

DFLD
DFLD
DO
DFLD
DFLD
ENDDO
FMTEND

TYPE=(3270,2), FEAT=IGNORE,
PFK=(PFKTEXT,7==-1,8== )
TYPE=INOUT
CURSOR = ((3,12))
CSC TRAINING INFORMATION,
POS=(1,25),ATTR=(PROT,HI)
POS=(2,15),LTH=10,ATTR=MOD
POS=(4,15),LTH=8,ATTR=MOD
10
POS=(2,15),LTH=15,ATTR=MOD
POS=(4,15),LTH=20,ATTR=MOD
-

X
-

Advanced DC Programming

Logical Paging
LPAGEMODE

MSG

TYPE=OUTPUT,SOR=(LAPGEX,IGNORE),
NEXT=LPAGEMID,PAGE=YES
SOR=DPAGE1

LPAGE1

LPAGE
SEG
MFLD
FIELD1,LTH=10
MFLD
FIELD2,LTH=8
DO
10
MFLD
FIELD3,LTH=15
MFLD
FIELD4,LTH=20
ENDDO
MSGEND
END

IMS Transaction Manager

Thank You
Kamakshigari Suresh
TSPL

Anda mungkin juga menyukai