WebSphere MQ Q Program Usage
===

I have a queue manager QM_TEST created using the following MQSC command:

      SET AUTHREC OBJTYPE(QMGR) GROUP('mq-user') AUTHADD(INQ,DSP,CONNECT,SET,SETALL)
      SET AUTHREC PROFILE(SYSTEM.MQEXPLORER.REPLY.MODEL) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(INQ,DSP,GET)
      SET AUTHREC PROFILE(SYSTEM.ADMIN.COMMAND.QUEUE) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(INQ,DSP,PUT)
      DEFINE CHANNEL ($cname) CHLTYPE (SVRCONN) TRPTYPE (TCP) MCAUSER('tcs-mq-user') REPLACE
      SET CHLAUTH($cname) TYPE(ADDRESSMAP) ADDRESS(*) MCAUSER('tcs-mq-user')
      DEFINE QLOCAL ($dlqname) REPLACE
      SET AUTHREC PROFILE($dlqname) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(ALL)
      ALTER  QMGR DEADQ($dlqname) FORCE
      DEFINE LISTENER ($lname) TRPTYPE (TCP) CONTROL (QMGR) PORT ($port)
      START LISTENER ($lname)

I have two queues TEST1 and TEST2 created using:

    DEFINE QLOCAL ($qname) GET(ENABLED) PUT(ENABLED) MAXDEPTH($maxdepth) REPLACE
    SET AUTHREC PROFILE($qname) OBJTYPE(QUEUE) GROUP('mq-user') AUTHADD(ALL)

I am trying to copy messages from TEST1 to TEST2 using the q program utility:

> q -xb -mQM_TEST -iTEST1 -mQM_TEST -oTEST2 -p20

However I get this error:

> MQSeries Q Program by Paul Clarke [ V6.0.0 Build:May  2 2012 ]
> Connecting ...failed. MQCONNX on object 'QM_TEST' returned 2035 Not
> authorized..

I am running WebSphere MQ v7.1. *q* SupportPac is installed on the server and I am executing the q command on the server. I can't figure out a way to pass the channel name TEST_CHANNEL, is that the issue? 

Also, how do I get the content of the queue into a file?