IMS Transaction Message Processing
Unit 6
Copyright IBM Corporation 2008 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.
5.1
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
IMS/TM Message Flow
User Terminal
z/OS VTAM MSG IMS/TM
Receive Task Scheduler Task
IMS/ MPR APPL
.... .... .... .... .... ....
IMS/ MPR APPL
.... .... .... .... .... ....
IMS/ BMP APPL
.... .... .... .... .... ....
IMS/ IFP APPL
.... .... .... .... .... ....
Queue Manager Expedited Message Handler
Message Queue
IMS DB(s)
Copyright IBM Corporation 2008
Message Classes and Priorities
TRANSACTIONS are assigned two (2) attributes:
Class, and Priority
CLASSES TRANSACTIONS (PRTY)
001
SKILLINQ (8) SKILLUPD (5) PAYROLL (4) INVENT (10) STOKSTAT (8)
002
003
ORDER RECEIVE
(6) (4)
Transactions are "grouped by" priority within class... Class and priority can be changed via /ASSIGN command
Copyright IBM Corporation 2008
Message "Scheduling"
Application programs are automatically scheduled only into
Message Processing Regions (MPRs) Driven by occurrences of "messages"...
IMS MESSAGE-QUEUE SKILLINQ CLASS=1, PRTY=8
IMS/ MPR1
Classes 2,3,4,1
IMS/ MPR2
Classes 3,4,5,6
IMS/ MPR3
Classes 4,5,6,7
MESSAGE 1
MESSAGE N
SKILLUPD CLASS=1, PRTY=5
MESSAGE 1 MESSAGE M
Copyright IBM Corporation 2008
IMS SCHEDULER TASK
Scheduled Transaction Flow
// EXEC PGM=DFSRRC00, PARM='MSG,002003004001...'
Control Region
Message Region 1
Application Program: ...
INPUT MESSAGE
DATABASE(S)
OUTPUT MESSAGE
GET MESSAGE ... ... ... ACCESS DB ... ... ... INSERT REPLY GET NEXT MSG TERMINATE
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
Message Queue "Limit Priority"
Additional factors affecting scheduling
IMS MESSAGE-QUEUE SKILLINQ CLASS=1, PRTY=(8,10,30) PROCLIM =20
TIME 1
TIME 2
TIME 3
MESSAGE 1 MESSAGE N
NORMAL PRIORITY LIMIT PRIORITY LIMIT COUNT QUEUE COUNT
8 10
30 8
8 10
30
8 10 30
30
SKILLUPD CLASS=1, PRTY=(9,12,4) PROCLIM=5
NORMAL PRIORITY
MESSAGE 1 MESSAGE 2
LIMIT PRIORITY LIMIT COUNT QUEUE COUNT
9 12 4 2
9 12 4 1
9 12 4 3
MESSAGE M
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
IMS GEN - Message Processing
APPLCTN TRANSACT PSB=INQPGM, PGMTYPE=(TP,,1) CODE=SKILLINQ, PRTY=(8,10,20), PROCLIM=20 PSB=UPDPGM, PGMTYPE=(TP,,1) CODE=SKILLUPD, PRTY=(5,12,4), PROCLIM=5 CODE=SKILLDLT, PRTY=(6,9,20) PSB=ORDPGM, PGMTYPE=(TP,,4) CODE=ORDERENT, PRTY=(8,12,4), SPA=(200) PSB=BILLPGM, PGMTYPE=(TP,,7) CODE=BILLING, PRTY=(12,14,5), SPA=(200) Class Class Class
APPLCTN TRANSACT
TRANSACT APPLCTN TRANSACT
APPLCTN TRANSACT
Class
Copyright IBM Corporation 2008
Message Processing Programs (MPPs)
SKILLNQ 123456
LTERM SF101
SKILLINQ RESULTS SCREEN
z/OS IMS/TM Control Region
1 2 3
MESSAGE QUEUED IMSMPR2 AVAILABLE IMSMPR1 AVAILABLE CONTROL BLOCKS LOADED HERE... 4. INQPGM LOADED, EXECUTION BEGINS HERE... 5. GET MESSAGE FROM QUEUE... 6. GET DB SEGMENTS FOR INQUIRY... 7. INSERT MESSAGE REPLY BACK TO THE QUEUE 8. TERMINATE 9. SEND MESSAGE FROM QUEUE TO TERMINAL
(Class 2,3,4,1)
IMS/MPR1
IMS/MPR2
(Class 4,5,6,7)
THIS REGION WAITING FOR WORK
PGMLIB
SKILLINQ XXX INVENTUP XXX
PGMLIB
INVPGM VENPGM
RESULTS
INQPGM UPDPGM
Copyright IBM Corporation 2008
Message Processing Calls
FUNCTION
RETRIEVING MESSAGES: GET UNIQUE GET NEXT
PCB
IO-PCB IO-PCB
CODE
GUbb GNbb
SENDING MESSAGES to ORIGINATING TERMINAL: INSERT
IO-PCB
ISRT
SENDING MESSAGES to ALTERNATE TERMINALS: CHANGE INSERT PURGE CHECKPOINTING of the BATCH APPLICATION: CHECKPOINT SYNC-POINT
ALT-PCB ALT-PCB ALT-PCB
CHNG ISRT PURG
IO-PCB IO-PCB
Copyright IBM Corporation 2008
CHKP SYNC
Conversational Processing
SCRATCH-PAD AREA
NAME: JOHN DOE ADDR: 123 MAIN CHICAGO ZIP: 60601 ACCT: 12-3456
ORDERENT
BEFORE
'ORDPGM' PROGRAM
ORDERENT 0000 00000000000000 00000000000000 ORDERENT DOE,J 12-3456 000000 00000000000000
AFTER
SCRATCH-PAD AREA
ORDER; 98765 ITEM QTY DESC 1 50 BLUE 2 75 RED 3
BEFORE
'ORDPGM' PROGRAM
AFTER
ORDERENT DOE,J 12-3456 000000 00000000000000 ORDERENT DOE, J 12-3456 98765 50 BLUE 75 RED
SCRATCH-PAD AREA
ORDER: 98765 PRICE: 50.00 TAX : 5.00 TOTAL: 55.00 ORDER COMPLETE
BEFORE
'ORDPGM' PROGRAM
AFTER
ORDERENT DOE, J 12-3456 000000 50 BLUE 75 RED BBBBBBBB DOE, J 12-3456 98765 50 BLUE 75 RED
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
IMSGEN
APPLCTN PSB=HQPGM, PGMTYPE=(BATCH)
TRANSACT CODE=HQUPDT, PRTY=(0) APPLCTN PSB=DB2PGM, PGMTYPE=(BATCH)
Copyright IBM Corporation 2008
Batch Message Processing (BMP) (2 of 2)
Non-Transaction Oriented BMP
// EXEC PGM=DFSRRC00, PARM='BMP,PGMNAME,PSB,...'
Control Region
Batch Message Region
Application Program: ... ... READ z/OS DATA SET ... ... ACCESS DB(S) ... ... CALL 'CHKP' GET NEXT I/P TERMINATE
DATABASE(S)
Copyright IBM Corporation 2008
APPC
APPC is the most commonly used SNA protocol when accessing IMS from a CGI program
Conversational Model APPC Supports
Asynchronous Synchronous
interactive
... SEND RCV ...
CGI Pgm
IMS
scheduling
RCV ... SEND
CGI Pgm
IMS SNA
APPC Calls
APPC Calls
APPC Calls GU ... ISRT
SNA
APPC Calls
IMS appl pgm
Standard
Copyright IBM Corporation 2008
CPIC Driven
IMS APPC Explicit API Flow
CONTROL REGION MPP
IMS
CONFIRM
RECEIVE ... SEND-DATA request
APPC/MVS
APPC/VTAM VTAM BASE
LU 6.2 DEVICE
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
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) IMS Data Comm. APPC Comm. (Using XCF)
OTMA Callable Interface
I M S T M
Open Transaction Manager Access (OTMA)
Transaction Manager
IMS Message Queues
Appl. DB2
Appl.
...
Appl.
Open DB Access Facility
IMS Database Manager
Copyright IBM Corporation 2008
TCP/IP OTMA Connection
Provides improved access via TCP/IP
z/OS
TCP/IP for z/OS
WebSphere
IMS Connect (BPE)
IMS Connector for Java
IMS
OTMA
XCF
TCP/IP
IMS TCP/IP Client
TRAN User Exit DATA User Exit
Copyright IBM Corporation 2008
IMS Connect
Back-end Services (IMS) Internet
z/OS
TCP/IP
IMS Connect
IMS XCF OTMA
IMS Application Programs
Java Application using IMS Connector for Java
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
Copyright IBM Corporation 2008