MainframeSupports
tip week 2/2005:

MQ has an online interface where you can maintain MQ definitions. There is a lot of things to be said about this interface and normally it can be started using the command TSO MQM in ISPF unless the creative people responsible for MQ has renamed the command.

Among us there still are some people who prefer batch interfaces like myself. I think the batch interface to MQ is a good one. Try out this piece of JCL:

//MQUTIL   EXEC PGM=CSQUTIL,PARM='MYMQ'
//SYSPRINT DD SYSOUT=*
//MYOUTPUT DD SYSOUT=*,LRECL=80,RECFM=FB
//SYSIN   DD *
  COMMAND MAKEDEF(MYOUTPUT)
/*
//CSQUCMD  DD *
  DISPLAY QUEUE(MY.EXISTING.QUEUE) ALL
/*

This step will produce a ready to use MQ definition on DD name MYOUTPUT if MY.EXISTING.QUEUE is a queue defined on the MQ manager MYMQ. Instead of pouring out the definition on SYSOUT=* you can just as well use a dataset or member. Then you could edit the definition or change the name of the queue to create a new definition. If you want to change the existing definition then you must change the parameter NOREPLACE to REPLACE. Now all you need are to implement the new or changed definition. This can be done using the following step:

//MQUTIL   EXEC PGM=CSQUTIL,PARM='MYMQ'
//SYSPRINT DD SYSOUT=*
//SYSIN   DD *
  COMMAND
/*
//CSQUCMD  DD DISP=SHR,DSN=MY.MQ.DEF(INITION)

Now this is really easy. I almost applauded when I realized how easy it is. But, but, but the last step always ends with a return code of 0 even when MQ fails to create or replace the definition. Therefore you have to check your SYSPRINT output. I have been told that you are able to make CSQUTIL return some useful return code, but I haven't been told how. One good thing is that the definitions are validated for syntax errors before authorization is enforced. This is a huge advantage if you do not have the proper authorization to carry out the commands yourself, but have to let other people do the dirty work. Then you eliminate the risk of getting nasty comments from the people that you have to rely on in order to carry out the definition making.

Previous tip in english        Sidste danske tip        Tip list