I use Natural Mainframe, and would like a code example to write in the MQSeries queues.Thanks
Which environment - Batch ? COM-PLETE ? CICS ? TSO ? … ?
Natural as a client ? As a server ? Both ?
If you’re talking strictly from a programming perspective and not from an installation perspective, what you want to do is make LDAs out of the MQ Series copybooks so you can use MQ-terminology to set various codes and parameters when using the MQOPEN, MQGET, MQPUT and MQCLOSE interfaces which you can CALL from Natural. The amount of code to make this all happen is modular by design as it’s best to isolate MQ coding from application coding, and would be too much to share it all here but I am willing to address specific questions.
If your question is on how to make MQOPEN, etc, callable from Natural, that’s a whole different topic and just as complex but involves including these modules as CSTATIC and enabling LE support (as these are COBOL modules).
I hope this at least gets you thinking the approach you need to take in strategy. You will have to decide how you want your application to work (put a message and forget about it, put a message and wait for a reply, put a message and have an asynchronous response, trigger a process, poll a queue, etc etc) and design your MQ modules to support that. We have various behaviours coded on the “message service” layer so the applications can just perform our message service subroutines.
We also found what works best is to have a trans queue and a data queue correlated by message id / correl id so that the triggered/polling module listening on the trans queue (or invoked by it) knows how many data messages to get.
Then there’s the whole issue of MQ calls to the mainframe triggering a transaction id which we set up as a COBOL program which invokes Natural.
I mention all these high-level topics just to inform you that almost anything is possible and you just have to decide how you want to set it up.
Check also if EntireX WebSphere MQ RPC Server helps simplify your programming tasks: