Programming considerations

Top  Previous  Next

When correctly setup, programs running under XCICS/TS will be able to call WSMQ API CALLs (i.e. MQPUT, MQGET).

MQCONN and MQDISC should not be called: XCICS/TS takes care about the connection to the WSMQ queue manager and provides a default connection.

Like IBM CICS, each XCICS/TS region may have only one connection to WSMQ. This connection is part of the LUW (Logical Unit of Work) and therefore it is under the transactional control of XCICS/TS. EXEC CICS SYNCOPINT or SYNCPOINT ROLLBACK must be used in place of MQBEGIN, MQCMIT and MQBACK.

WARNING: WSMQ API calls have a different behaviour on mainframe and UNIX/Linux system. On mainframe systems, WSMQ API calls are put by default within the LUW, while on UNIX/Linux systems, they are not put within the LUW by default.

Because of this difference, programs calling WSMQ API should specify explicitly MO_SYNCPOINT or MO_NO_SYNCPOINT in the WSMQ API calls.

I.e.

mainframe code:

       CALL 'MQPUT' USING HCONN,
                          Q-HANDLE,
                          MESSAGE-DESCRIPTOR,
                          PMOPTIONS,
                          BUFFER-LENGTH,
                          IO-BUFFER,
                          COMPLETION-CODE,
                          REASON.

UNIX/Linux code:

      MOVE MQPMO-SYNCPOINT TO MQPMO-OPTIONS OF PMOPTIONS
       CALL 'MQPUT' USING HCONN,
                          Q-HANDLE,
                          MESSAGE-DESCRIPTOR,
                          PMOPTIONS,
                          BUFFER-LENGTH,
                          IO-BUFFER,
                          COMPLETION-CODE,
                          REASON.