Snowcrash
Snowcrash

Reputation: 86367

IBM MQ: DISPLAY CHANNEL command - syntax error

I'm trying to Display IBM MQ channels using

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q086040_.htm

I defined a channel named MYMQ.SVRCONN, however, this gives me a syntax error:

runmqsc
DISPLAY CHANNEL MYMQ.SVRCONN
 5 : DISPLAY CHANNEL MYMQ.SVRCONN

AMQ8405: Syntax error detected at or near end of command segment below:- DISPLAY CHANNEL

I get the same problem with:

DISPLAY CHANNEL *

Any suggestions why?

I'm struggling to understand this syntax:

>>-DISPLAY CHANNEL--(--generic-channel-name--)------------------>

so bonus points if you can explain how syntax works.

Upvotes: 2

Views: 7594

Answers (1)

JoshMc
JoshMc

Reputation: 10672

The ( and ) are part of the required syntax.

In the examples you give the commands should be:

DISPLAY CHANNEL(MYMQ.SVRCONN)

or

DISPLAY CHANNEL(*)

Most MQSC command have a similar syntax of:

<command> <object type>(<object name>) [optional parameters]

A few examples:

  1. DEFINE CHL(MYMQ.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('xyzuser')
  2. ALTER CHL(MYMQ.SVRCONN) CHLTYPE(SVRCONN) DESCR('Test channel')
  3. DISPLAY CHL(MYMQ.SVRCONN) MCAUSER

The QMGR object is one of the exceptions where the object type does not need to be followed by a object name since when you run these commands you are connected to a specific queue manager:

  1. DIS QMGR CHLAUTH CONNAUTH
  2. ALTER QMGR CHLAUTH(ENABLED)

A few things to note:

  1. IBM MQ will always fold to UPPER case anything that is not surrounded in single quote ' characters.
  2. Some DISPLAY commands by default display only a subset of all parameters on an object. You can use the special parameter ALL to have it display all of them or you can indicate specific parameters you would like to display.
  3. DISPLAY commands can also use a WHERE clause, for example: DIS CHL(*) WHERE(MCAUSER eq 'xyzuser') DESCR

Upvotes: 4

Related Questions