cm016g06
DESCRIPTION
yjgygTRANSCRIPT
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1
© Copyright IBM Corporation 2008
IMS Transaction Message Processing
Unit 6
© Copyright IBM Corporation 2008
Objectives
• Discover the message flow from terminals through IMS/TM or EMH to an MPR and how application programs (MPPs) are scheduled
• Discover the components and flow of MPPs (message processing programs)
• Learn a little about the macros that define MPPs to IMS/TM• Differentiate BMPs from MPPs and learn about extended
checkpoints and restart• Learn some of the implications of APPC• Identify the functions of OTMA (Open Transaction Manager
Access) and IMS Connect
© Copyright IBM Corporation 2008
User Terminal
z/OS
VTAM IMS/ MPR
IMS/ MPR
IMS/ BMP
IMS/ IFP
MSG
IMS/TM
Receive Task
Scheduler Task
Queue Manager
Expedited Message Handler
APPL
........................
APPL
........................
APPL
........................
APPL
........................
Message Queue
IMS DB(s)
IMS/TM Message Flow
© Copyright IBM Corporation 2008
001
002
003
SKILLINQ (8)SKILLUPD (5)PAYROLL (4)
INVENT (10)STOKSTAT (8)
ORDER (6)RECEIVE (4)
CLASSES TRANSACTIONS (PRTY)
Message Classes and Priorities
• TRANSACTIONS are assigned two (2) attributes:– Class, and– Priority
– Transactions are "grouped by" priority within class...– Class and priority can be changed via /ASSIGN command
© Copyright IBM Corporation 2008
IMS MESSAGE-QUEUE
SKILLINQCLASS=1, PRTY=8
MESSAGE 1
MESSAGE N
SKILLUPDCLASS=1, PRTY=5
MESSAGE 1
MESSAGE M
IMS/MPR1
IMS/MPR2
IMS/MPR3
Classes2,3,4,1
Classes3,4,5,6
Classes4,5,6,7
IMS S
CH
ED
ULE
R T
ASK
Message "Scheduling"
• Application programs are automatically scheduled only into– Message Processing Regions (MPRs)– Driven by occurrences of "messages"...
© Copyright IBM Corporation 2008
Control Region Message Region 1
INPUT MESSAGE
DATABASE(S)
OUTPUT MESSAGE
GET MESSAGE . . . . . . . . .ACCESS DB . . . . . . . . .INSERT REPLYGET NEXT MSGTERMINATE
Application Program: . . .
// EXEC PGM=DFSRRC00, PARM='MSG,002003004001...'
Scheduled Transaction Flow
© Copyright IBM Corporation 2008
COBOL Coding Example
READ THE INCOMING MESSAGE:CALL 'CBLTDLI' USING GU, IOPCB, IO-AREA
CHECK THE STATUS CODE:
IF STATUS-CODE = 'QC' END THE PROGRAM - OUT OF MESSAGES
HANDLE THE REQUEST:BLAH, BLAH, BLAH.
SEND THE REPLY
CALL 'CBLTDLI' USING ISRT, IOPCB, IO-AREA.
LOOP TO THE TOP TO GET THE NEXT MESSAGE.
© Copyright IBM Corporation 2008
IMS MESSAGE-QUEUE
SKILLINQCLASS=1,PRTY=(8,10,30)PROCLIM =20
MESSAGE 1
MESSAGE N
SKILLUPDCLASS=1,PRTY=(9,12,4)PROCLIM=5
MESSAGE 1
MESSAGE 2
MESSAGE M
NORMAL PRIORITY
LIMIT PRIORITY
LIMIT COUNT
QUEUE COUNT
NORMAL PRIORITY
LIMIT PRIORITY
LIMIT COUNT
QUEUE COUNT
TIME 1 TIME 2 TIME 3
912 4 2
912 4 1
9 12 4 3
10
30
0
10
30
8
10
30
30
88 8
Message Queue "Limit Priority"
• Additional factors affecting scheduling
© Copyright IBM Corporation 2008
Message Region Options
• More scheduling options
• "Wait-For-Input (WFI)" transactions:– Allows a program to remain scheduled to wait for the next
transaction, subject to PROCLIM=• Parallel-scheduling:
– Allows the same program to be scheduled in parallel address-spaces at the same time• IF processing a different transaction code• Subject to queue-count of each transaction code Upper limit maximum
• Preload of application programs into certain regions– Program is "ready and waiting" when application schedules
© Copyright IBM Corporation 2008
Dynamic Transaction Backout
• When the program reads the incoming message:– Call 'CBTDLI' using GU, IOPCB...
• All updates and messages for the previous transaction are committed.
ABEND
• Dynamic transaction backout is invoked automatically when a program abends.
• Any uncommitted updates or messages are purged when a program abends.
• Any uncommitted updates or messages are purged from the system.
© Copyright IBM Corporation 2008
APPLCTN PSB=INQPGM,PGMTYPE=(TP,,1) Class
TRANSACT CODE=SKILLINQ,PRTY=(8,10,20),PROCLIM=20
APPLCTN PSB=UPDPGM,PGMTYPE=(TP,,1) Class
TRANSACT CODE=SKILLUPD,PRTY=(5,12,4),
PROCLIM=5
TRANSACT CODE=SKILLDLT, PRTY=(6,9,20)
APPLCTN PSB=ORDPGM,PGMTYPE=(TP,,4) Class
TRANSACT CODE=ORDERENT, PRTY=(8,12,4), SPA=(200)
APPLCTN PSB=BILLPGM,PGMTYPE=(TP,,7) Class
TRANSACT CODE=BILLING, PRTY=(12,14,5),
SPA=(200)
IMS GEN - Message Processing
© Copyright IBM Corporation 2008
SKILLINQ XXX
INVENTUP XXX
RESULTS
IMS/TMControlRegion
1 MESSAGE QUEUED
2 IMSMPR2 AVAILABLE IMSMPR1 AVAILABLE
3 CONTROL BLOCKS LOADED HERE...
IMS/MPR1 IMS/MPR2(Class 2,3,4,1)
(Class 4,5,6,7)
z/OS
4. INQPGM LOADED, EXECUTION BEGINS HERE...5. GET MESSAGE FROM QUEUE...6. GET DB SEGMENTS FOR INQUIRY...7. INSERT MESSAGE REPLY BACK TO THE QUEUE8. TERMINATE
THIS REGION WAITING FOR
WORK
9. SEND MESSAGE FROM QUEUE TO TERMINAL
LTERMSF101
PGMLIB
INQPGMUPDPGM
INVPGMVENPGM
PGMLIB
SKILLNQ123456
SKILLINQRESULTS SCREEN
Message Processing Programs (MPPs)
© Copyright IBM Corporation 2008
FUNCTION PCB CODE
RETRIEVING MESSAGES: GET UNIQUE GET NEXT
IO-PCBIO-PCB
GUbbGNbb
SENDING MESSAGES to ORIGINATING TERMINAL: INSERT IO-PCB ISRT
SENDING MESSAGES to ALTERNATE TERMINALS: CHANGE INSERT PURGE
ALT-PCBALT-PCBALT-PCB
CHNGISRTPURG
CHECKPOINTING of the BATCH APPLICATION: CHECKPOINT SYNC-POINT
IO-PCBIO-PCB
CHKPSYNC
Message Processing Calls
© Copyright IBM Corporation 2008
SCRATCH-PAD AREA
'ORDPGM'PROGRAM
'ORDPGM'PROGRAM
'ORDPGM'PROGRAM
SCRATCH-PAD AREA
SCRATCH-PAD AREA
ORDERENT 00000000000000000000000000000000
ORDERENT DOE,J12-3456 00000000000000000000
ORDERENT DOE, J12-3456 9876550 BLUE 75 RED
ORDERENT DOE,J12-3456 00000000000000000000
ORDERENT
ORDERENT DOE, J12-3456 00000050 BLUE 75 RED
BBBBBBBB DOE, J12-3456 9876550 BLUE 75 RED
BEFORE
BEFORE
BEFORE
AFTER
AFTER
AFTER
NAME: JOHN DOEADDR: 123 MAIN CHICAGO ZIP: 60601ACCT: 12-3456
ORDER; 98765ITEM QTY DESC1 50 BLUE2 75 RED3
ORDER: 98765PRICE: 50.00TAX : 5.00TOTAL: 55.00 ORDER COMPLETE
Conversational Processing
© Copyright IBM Corporation 2008
Batch Message Processing (BMP) (1 of 2)
• Programs are "batch" programs– Submitted when ready by Operations
• May or may not access the message queue:– 1. Transaction oriented BMP: processes input messages and inserts
output reply• BMP address-space JCL parameters (IN= , OUT=)
– 2. Non-transaction oriented BMP: access databases only
• IMSGENAPPLCTN PSB=HQPGM,
PGMTYPE=(BATCH)
TRANSACT CODE=HQUPDT, PRTY=(0)
APPLCTN PSB=DB2PGM,PGMTYPE=(BATCH)
© Copyright IBM Corporation 2008
Control Region
DATABASE(S)
Batch Message Region
Application Program:. . .. . .
READ z/OSDATA SET
. . .. . .
ACCESS DB(S). . . . . .
CALL 'CHKP'GET NEXT I/PTERMINATE
// EXEC PGM=DFSRRC00, PARM='BMP,PGMNAME,PSB,...'
Batch Message Processing (BMP) (2 of 2)
• Non-Transaction Oriented BMP
© Copyright IBM Corporation 2008
• APPC is the most commonly used SNA protocol when accessing IMS from a CGI program– Conversational Model– APPC Supports
• Asynchronous• Synchronous
– interactive
CGI Pgm IMS
SNAAPPC Calls
APPC Calls
GU...ISRT
CGI Pgm IMS
SNAAPPC Calls
scheduling
APPC Calls
IMS appl pgm
Standard CPIC Driven
...SENDRCV...
RCV...SEND
APPC
© Copyright IBM Corporation 2008
IMS
CONTROL MPPREGION RECEIVE
. . . SEND-DATA request CONFIRM
APPC/MVS
LU 6.2DEVICE
APPC/VTAM
VTAM BASE
IMS APPC Explicit API Flow
© Copyright IBM Corporation 2008
APPC Support
• APSB (allocate PSB) call– Dynamically allocate a PSB– CPIC driven programs have no access to a PSB when scheduled– Allows access to IMS resources when application is CPIC driven
• DL/I data bases• Alternate PCB output
• All transaction modes supported for current and modified programs– Conversational– Response– Non-response
© Copyright IBM Corporation 2008
IMS Data Comm.
APPC Comm. (Using XCF)
Open Transaction Manager Access (OTMA)
OTMA and OTMA Callable Interface
• IMS Component providing enhanced access to IMS from middleware
SNA Network TCP/IP MQSeries DCE/RPC WebSphere TCP/IP Client
Common Interface (XCF)OTMA Callable
Interface
Transaction Manager IMS Message
Queues
IMS
TM
Appl. Appl. Appl.. . .
DB2 IMS Database Manager
Open DB Access Facility
© Copyright IBM Corporation 2008
z/OS
TCP/IP for z/OS
IMS Connect(BPE)
IMS
TRAN
DATA
OTMA XCF
User Exit
User Exit
WebSphere
IMS Connector for Java
IMS TCP/IP Client
TCP/IP
TCP/IP OTMA Connection
• Provides improved access via TCP/IP
© Copyright IBM Corporation 2008
Back-end Services (IMS)
z/OS
IMS Connect
IMS
OTMA
IMS Application Programs
Java Applicationusing
IMS Connector for Java
XCF
TCP/IP
Internet
IMS Connect
© Copyright IBM Corporation 2008
Unit Summary
• Transactions are scheduled as a function of matching classes defined in MPR JCL with the class (CLASS) and priority (PRTY, PROCLIM) assigned to a transaction in an IMSGEN
• Message processing programs (MPPs) receive messages from terminals by issuing get calls (GU and GN) and return messages with insert calls (ISRT) to an I/O PCB
• Application transactions are defined in an IMSGEN using APPLCTN and TRANSACT macros
• BMPs execute during online processing and should also have checkpoint and restart logic
• APPC programs can contain dynamic allocations of PCBs and are scheduled by IMS, however, other IMS/TM communication processes are bypassed
• OTMA provides the facility for IMS to communicate with IMS applications other than VTAM, such as TCP/IP
• IMS Connect provides enhanced TCP/IP support for easy access to IMS from the Internet