By default, the implementation of the IDMS MQ adapter API functions provided with SO07191 is such that MQ application programs should invoke the API statically, and that IDMS internally invokes MQ dynamically.
This is the recommended mode of operation as it offers the best performance.
However, for reasons of compatibility with existing code, it may be desirable to have MQ application programs invoke the API dynamically.
This document describes how this can be accomplished.
Release : 19.0
Component : CA IDMS/DB
The default behaviour of the IDMS MQ adapter functions is that they be invoked statically. This means that:-
* RHDCD1MQ is used as provided (i.e., its link-edit does not include the IBM MQ stub module CSQBSTUB)
* The CSQBSTUB must be made available to the CV via the CDMSLIB ddname.
* IDMSMQI is used as provided and not re-linked in any way.
* Application programs must include IDMSMQI in their link-edit.
It also means that application program MQ functions are invoked in the following manner:
COBOL
CALL 'MQCONN' USING WS-QMGR WS-HCONN WS-COMPCODE WS-REASON.
Assembler
L R15,=V(MQCONN)
BASR R14,R15
PL/I
CALL MQCONN( ... )
ADS
Use the ADS built-in-functions, e.g. MQCONN(QManagerName, ConnectionHandle, CompCode, RsnCode)
In order to allow the IDMS MQ adapter functions to be invoked dynamically, the following steps must be done.
Re-link IDMSMQI
IDMS module IDMSMQI must be re-linked using the following SYSIN.
Be sure to re-link it into CUSTOM.LOADLIB and not override the provided IDMSMQI.
//SYSIN *
INCLUDE AAGJMOD(IDMSMQI)
ENTRY IDMSMQI
ALIAS MQBACK(MQBACK)
ALIAS MQCLOSE(MQCLOSE)
ALIAS MQCMIT(MQCMIT)
ALIAS MQCONN(MQCONN)
ALIAS MQDISC(MQDISC)
ALIAS MQGET(MQGET)
ALIAS MQINQ(MQINQ)
ALIAS MQOPEN(MQOPEN)
ALIAS MQPUT(MQPUT)
ALIAS MQPUT1(MQPUT1)
ALIAS MQSET(MQSET)
ALIAS MQSTAT(MQSTAT)
SETOPT PARM(REUS=SERIAL)
NAME IDMSMQI(R)
Note: it is now no longer necessary to include IDMSMQI in the link-edit of application programs.
Define the function modules to the IDMS System Generation
All of the modules mentioned as an ALIAS in the above SYSIN must be defined to the IDMS System Generation as a PROGRAM with the SAVEAREA attribute.
For example:
ADD PROGRAM MQCONN
LANGUAGE IS ASSEMBLER
SAVEAREA
.
Re-link RHDCD1MQ
Internally, IDMS must now invoke MQ statically.
Therefore, RHDCD1MQ must be re-linked using the following SYSIN.
Be sure to re-link it into CUSTOM.LOADLIB and not override the provided RHDCD1MQ.
//SYSIN *
ORDER RHDCD1MQ, CSQBSTUB
INCLUDE CAGJLOAD(RHDCD1MQ)
INCLUDE SCSQLOAD(CSQBSTUB)
ENTRY D1MQEP1
SETOPT PARM(REUS (SERIAL))
NAME RHDCD1MQ(R)
Note: it is now no longer necessary to have the CSQBSTUB module in the CV CDMSLIB.
With the above in place, the API function calls can be dynamic. Examples:
COBOL
MOVE 'MQCONN' TO WS-MQCONN.
CALL WS-MQCONN USING WS-QMGR WS-HCONN WS-COMPCODE WS-REASON.
Or use the IDMS TRANSFER CONTROL verb
Assembler
#LINK
PL/I
TRANSFER TO ('MQCONN') ...
ADS
LINK TO PROGRAM 'MQCONN' ...
When compiling MQ related programs and including IDMSMQI in the link edit, it is possible to encounter the following warning message:
IEW2609W 5104 SECTION IDMSMQI USABILITY ATTRIBUTE OF REUSABLE CONFLICTS WITH REQUESTED USABILITY OF REENTRANT.
It is safe to ignore this warning.
MQ Adapter API Support
Optional Steps (for dynamic invokation of MQ API functions)