Can I filter MQ "display queue" on NOT some queue names?

Viewed 1514

I'm losing my ever-loving mind over this one.

I'm trying to output a list of local queues with their current depth and maximum depth. The following command basically does the job:

display qlocal(*) curdepth maxdepth

However, I'm getting all the SYSTEM.* queues and I don't want them in the list. Theoretically I can use the where( ) filter to do this, but it seems like this most useful function is just not possible because...

display qlocal(*) where(???? nl 'SYSTEM*') curdepth maxdepth

...what do I put for ???? I've tried all sorts including the seemingly obvious 'queue' but nothing works. Am I stuck with separately processing the output (a chore at the best of times due to its horrid formatting) to rid myself of these?

1 Answers

The command below might help. As you can't filter using the queue name in the 'where' parameter, the best solution would be to parse the output. The below command basically formats the mqsc object output to single lines and the egrep removes everything that starts with SYSTEM.

echo "dis ql(*) curdepth maxdepth" | runmqsc QMNAME |  sed 's/^[^  ].*$/%/g' | tr -s " " | tr -d "\n" | tr "%" "\n" | egrep -v "^ QUEUE\(SYSTEM"
Related