10.3.1 OTMA Prerouting User Exit (DFSYPRX0)
The following is the sample IBM OTMA prerouting user exit which can be found in the dataset BEATCPI
source. The IBM DFSYPRX0
user exit enables IMS to search for a destination for an application request. In the following sample, the lines in bold are modifications that you must make to the IBM DFSYPRX0
user exit.
Listing D‑2 OTMA Pre-routing Sample User Exit (DFSYPRX0)
TITLE 'DFSYPRX0: OTMA PRE-ROUTING USER EXIT'
DFSYPRX0 CSECT
DFSYPRX0 AMODE 31
DFSYPRX0 RMODE ANY
********************************************************************
* *
* DESCRIPTION: OTMA PRE-ROUTING USER EXIT *
* *
***********************************************************@SCPYRT**
* *
* Licensed Materials - Property of IBM *
* *
* "Restricted Materials of IBM" *
* *
* 5655-158 (C) Copyright IBM Corp. 1991,1996 *
* *
***********************************************************@ECPYRT**
* *
* MODULE TYPE: DC *
* *
* PROCESSOR: ASSEMBLER H *
* *
* MODULE SIZE: SEE EXTERNAL SYMBOL DICTIONARY PRODUCED BY *
* ASSEMBLER *
* *
* ATTRIBUTE: REENTRANT *
* *
* ENTRY POINT: DFSYPRX0 *
* *
* ENTRY INTERFACES : *
* *
* STATUS: RELEASE 5.1 CHANGE LEVEL - 0 *
* *
* FUNCTION: THIS MODULE IS CALLED BY IMS WHEN AN APPLICATION *
* CALL (IE CHNG OR ISRT) RESULTS IN A SEARCH FOR *
* A DESTINATION. *
* DFSYPRX0 DETERMINES IF: *
* 1. IMS SHOULD SEARCH FOR THE DESTINATION *
* WITHOUT LOOKING AT ANY OTMA DESTINATIONS *
* (LEGACY PROCESSING). *
* 2. IMS SHOULD INCLUDE OTMA DESTINATIONS, *
* AND PROVIDE A DESTINATION CLIENT MEMBER *
* NAME IF NECESSARY. *
* *
* DEPENDENCY: IMS/ESA 5.1 *
* *
* MODULE TYPE: PROCEDURE *
* ATTRIBUTE: RE-ENTRANT *
* PROCESSOR: ASSEMBLER H *
* *
* REGISTERS: STANDARD ENTRY AND EXIT *
* *
* MODULE SIZE: SEE ASSEMBLER LISTING *
* *
* LINKAGE: BALR 14,15 *
* *
* *
********************************************************************
EJECT
***********************************************************************
* *
* INTERFACE: *
* *
* CONTENTS OF REGISTERS AT ENTRY: *
* R1 = ADDRESS OF STANDARD IMS USER EXIT PARMLIST *
* *
* STANDARD PARMLIST *
* --------- *
* | | *
* |---------| *
* | | *
* |---------| *
* | | DFSYPRX0 PARMLIST *
* +12 |---------| |---------------| *
* | |---->|INPUT LTERM | +0 *
* --------- |---------------| *
* |DEST NAME | +8 *
* |---------------| *
* |TRAN NAME | +16 *
* |---------------| *
* |FLAGS | +24 *
* |---------------| *
* |USER ID | +28 *
* |---------------| *
* |GROUP | +36 *
* |---------------| *
* |RESERVED | +44 *
* |---------------| *
* |CLIENT MEM NAME| +48 *
* |---------------| *
* |A(MCI) | +64 *
* |---------------| *
* |A(STATE DATA) | +68 *
* |---------------| *
* |A(USER DATA) | +72 *
* |---------------| *
* |RESERVED | +76 *
* |---------------| *
* |A(MEM OVERRIDE)| +80 *
* |---------------| *
* *
* *
* R13 = SAVE AREA ADDRESS *
* R14 = RETURN ADDRESS *
* R15 = ENTRY POINT ADDRESS *
* *
* *
***********************************************************************
EJECT
***********************************************************************
* *
* CONTENTS OF OTMA PRE-ROUTING USER EXIT PARMLIST: *
* *
* +0 = 8-BYTE NAME OF LTERM/TPIPE WHICH *
* INVOKED THE CURRENT TRANSACTION *
* (LEFT-JUSTIFIED, PADDED WITH BLANKS) *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +8 = 8-BYTE DESTINATION NAME *
* (LEFT-JUSTIFIED, PADDED WITH BLANKS) *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +16 = 8-BYTE TRANSACTION NAME *
* (LEFT-JUSTIFIED, PADDED WITH BLANKS) *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +24 = 1-BYTE FLAG *
* X'80' - IF SET, INDICATES THAT AN INPUT *
* OTMA PREFIX EXISTS. THE MCI, *
* STATE DATA, AND USER DATA ARE *
* ACCESSIBLE IN THIS PARMLIST. *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +25 = SYNCRONIZATION LEVEL IF THE INPUT WAS *
* FROM AN OTMA CLIENT. *
* *
* +26 = 2-BYTE RESERVED *
* *
* +28 = 8-BYTE USERID *
* (LEFT-JUSTIFIED, PADDED WITH BLANKS) *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +36 = 8-BYTE GROUP ID *
* (LEFT-JUSTIFIED, PADDED WITH BLANKS) *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +44 = 4-BYTE RESERVED *
* *
* +48 = 16-BYTE NAME OF INPUT CLIENT MEMBER NAME *
* IF INPUT WAS FROM A CLIENT, BLANKS OTHERWISE. *
* (LEFT-JUSTIFIED, PADDED WITH BLANKS) *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +64 = ADDR(MESSAGE CONTROL INFORMATION), *
* AVAILABLE FROM INPUT OTMA MESSAGE PREFIX. *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +68 = ADDR(STATE DATA), *
* AVAILABLE FROM INPUT OTMA MESSAGE PREFIX. *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +72 = ADDR(USER DATA), *
* AVAILABLE FROM INPUT OTMA MESSAGE PREFIX. *
* THIS IS AN ENTRY PARAMETER ONLY. *
* *
* +76 = 4-BYTE RESERVED *
* *
* +80 = ADDR(16-BYTE MEMBER OVERRIDE) *
* THIS FIELD IS USED WHEN THE TRANSACTION IS *
* INVOKED FROM A NON-OTMA LTERM, TO INDICATE *
* THE CLIENT NAME WHEN AN OTMA DESTINATION *
* IS DESIRED. *
* (LEFT JUSTIFIED, PADDED WITH BLANKS) *
* THIS IS AN EXIT PARAMETER ONLY. *
* *
* *
* CONTENTS OF REGISTERS AT EXIT: *
* *
* R15 = RETURN CODE *
* *
* RETURN CODE CAN BE ONE OF THE FOLLOWINGS: *
* 0 : CONTINUE DEFAULT PROCESSING: *
* IF THE TRANSACTION WAS INVOKED FROM AN *
* OTMA TPIPE, THEN OTMA FIND-DESTINATION *
* PROCESSING SHOULD OCCUR. *
* IF THE TRANSACTION WAS INVOKED FROM A NON-*
* OTMA LTERM, THEN LEGACY FIND-DESTINATION*
* PROCESSING SHOULD OCCUR. *
* 4 : OTMA FIND-DESTINATION PROCESSING SHOULD *
* OCCUR. IF THE TRANSACTION WAS ENTERED *
* FROM A NON-OTMA LTERM, THEN A CLIENT *
* MEMBER NAME MUST BE PROVIDED IN THE *
* PRE-ROUTING PARAMETER LIST. *
* 8 : LEGACY FIND-DESTINATION PROCESSING *
* SHOULD OCCUR. *
* *
* *
* *
* REGISTER 13 IS THE ADDRESS OF SAVE AREA. *
* *
* NORMAL LINKAGE CONVENTIONS FOR REGISTER 13, 14 AND 15 *
* *
* *
* *
***********************************************************************
*
*
SAVE (14,12),,DFSYPRX0&SYSDATE&SYSTIME
SPACE 2
LR R12,R15 MODULE ADDRESSABILITY
USING DFSYPRX0,R12
USING OTMAPARM,R10
USING SXPL,R9
*
LR R9,R1 LOAD PARAMETER BASE
L R10,SXPLFSPL OTMA SPECIFIC PARAMETERS
CLC OTMDEST,MYPIPE SPECIAL DESTINATION?
BNE PRX01500 B NO
ICM R8,15,OTMCOVRD GET ADDRESS OF OVERRIDING NAME
BZ PRX01550 B IF NO ADDRESS
MVC 0(16,R8),MYCLIENT SET OVERRIDING CLIENT NAME
LA R15,4 ROUTE TO OTMA
B PRX01600 RETURN
*
PRX01500 DS 0H
CLC OTMTRANS,MYTRAN SPECIAL TRANSACTION?
BNE PRX01550 B NO
LA R15,8 INVOKE LEGACY PROCESSING
B PRX01600 RETURN
*
PRX01550 DS 0H
LA R15,0 RC = 0
PRX01600 DS 0H
*
RETURN (14,12),,RC=(15) RETURN WITH RETURN CODE IN R15
SPACE 2
REQUATE
SPACE 2
MYPIPE DC CL8'BEAOPIPE' TEST TPIPE
MYTRAN DC CL8'BEACRP01' TEST TRANSACTION
MYCLIENT DC CL16'BEAOTMA01' TEST CLIENT
*
* DATA MACROS
*
DFSSXPL
BEAOTM
*
END