Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why won't the Conv option work in a MQGET?

Status
Not open for further replies.

Glazza

Technical User
Jun 2, 2004
7
GB
Another system is sending message to my queue in ASCII, my program states

MOVE MQMI-NONE TO MQMD-CORRELID
MOVE MQMI-NONE TO MQMD-MSGID
MOVE MQGMO-NO-WAIT TO MQGMO-OPTIONS
ADD MQGMO-CONVERT TO MQGMO-OPTIONS
ADD MQGMO-SYNCPOINT TO MQGMO-OPTIONS
MOVE LENGTH OF DSSMQ-MQ-MESSAGE TO DSSMQ-MSG-LENGTH
DSSMQ-DATA-LENGTH

CALL "MQGET"
USING DSSMQ-HCONN
, DSSMQ-Q-HANDLE
, DSSMQ-MESSAGE-DESCRIPTOR
, DSSMQ-GMOPTIONS
, DSSMQ-MSG-LENGTH
, DSSMQ-MQ-MESSAGE
, DSSMQ-DATA-LENGTH
, DSSMQ-COMPLETION-CODE
, DSSMQ-REASON-CODE

But the message is coming through as gobblygook. Translated the message on the queue in a readable form and it looks fine(ie correct format) so what is going wrong?
 
Yes, I have been informed that the message format on the MQMD is set to string. This is what I don't understand, all the manuals say if the message format is string and the MQGET has the convert option then the data should be converted to the receiving system's format
 
Just to be sure, the format needs to be 'MQSTR '.

Cheers,
Paul
 
Okay I'm getting closer now.....The program does the following MQ wise:- MQConnect, MQOpen for browse, MQGet first browse, MQGet next browse for all on queue (reads 6),MQclose. Then MQopen for get destructive, MQget, MQget reason codes says zero but message is like "_% ?> & ¬ /> "

Obviously the browse is screwing it up somehow but why?
 
Are you specifying CONVERT for the browse? If not, it will fill in the CCSID of your Message Descriptor structure with the original CCSID of the message. Then unless you reset this to your local CCSID subsequent GETs will not convert as the message is already in this CCSID.

If the first Browse does specify CONVERT we'll have to think of something else! But it might be useful to print out the CCSID for each GET (before and after) just to be sure it really is the one you want it to convert to.

Cheers,
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top