Supported Programming Languages for MQ Adapter

This article describes the programming languages that are supported by the MQ Adapter and how each language invokes MQ functionality.
idmscu19
This article describes the programming languages that are supported by the MQ Adapter and how each language invokes MQ functionality.
2
ADS/Online
This section describes the ADS/Online call interface for MQ. Applications that are written in CA ADS can use one of two methods to exploit MQ.
  • Use the built-in functions that are supplied by CA ADS. There is one built-in function for each supported MQ function. They follow the same general rules as other CA ADS built-in functions. Parameters can be records or record elements. The following example is sample code that is required to invoke the MQOPEN built-in function in your CA ADS dialog.
  • Use a CA ADS control statement to invoke the MQ call. The following example shows how to use the LINK control statement to invoke MQOPEN.
Example
Example of using LINK LINK TO PROGRAM 'MQOPEN' USING  (MQ-PARM2,CMQODV,MQ-PARM6,MQ-PARM5,MQ-PARM3,MQ-PARM4). Example of using a built in function MQOPEN(W03-HCONN,        CMQODV,        W03-OPENOPTIONS,        W03-HOBJ,        W03-COMPCODE,        W03-REASON) 
Each parameter must be a separate record when using the LINK TO PROGRAM.
We recommend using the built-in MQ functions. Built-in MQ functions are easier to use and provide the additional benefits:
  • Parameters can be a record element. When LINKing is used, each parameter must be defined as a separate record.
  • Calling a system-defined built-in function is more efficient than LINKing to another program type, optimizing performance.
COBOL
Programs that are written in COBOL use the CALL statement to invoke MQ functionality.
IDMS MQ API return and reason codes are contained in IDMSQRNC. For more information about the return codes, see MQ Error Codes.
Example
CALL 'MQOPEN' USING W03-HCONN                     MQOD                     W03-OPENOPTIONS                     W03-HOBJ                     W03-COMPCODE                     W03-REASON.
Parameter Declarations:
01 CONNECTIONHANDLE PIC S9(9) BINARY. 01 OBJECTDESCRIPTOR. COPY CMQODV. 01 OPTIONS PIC S9(9) BINARY. 01 HANDLEOBJECT PIC S9(9) BINARY. 01 COMPCODE PIC S9(9) BINARY. 01 RSNCODE PIC S9(9) BINARY.
HLASM
Programs that are written in HLASM use the CALL instruction to invoke the MQ functions.
IDMS MQ API return and reason codes are contained in IDMSQRNA. For more information about the return codes, see MQ Error Codes.
Example
CALL  MQOPEN,(LWACONH,LWAOBJD,LWAOPT,LWAHOBJ,LWACOMPC,LWARSNC),VL
PL/I
Programs that written in PL/I use the CALL statement to invoke MQ functionality.
Example
CALL 'MQOPEN' USING (W03_HCONN,        MQOD,        W03_OPENOPTIONS,        W03_HOBJ,        W03_COMPCODE,        W03_REASON);
Parameter Declarations:
dcl ConnectionHandle  fixed bin(31); dcl ObjectDescriptor  like MQOD; dcl Options           fixed bin(31); dcl ObjectHandle      fixed bin(31);  dcl CompCode          fixed bin(31); dcl RsnCode           fixed bin(31);