View previous topic :: View next topic
|
Author |
Message |
Sathiyendran
New User
Joined: 17 Jul 2015 Posts: 5 Location: India
|
|
|
|
When reading the response MQ, received the data in hexadecimal format. Response written with native encoding (273) and coded character set was 819 per qmgr.
want to convert the hexa decimal value to an alphanumeric value. Any suggestions please? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Two days and no answer...
If you still have a question, I strongly suggest showing examples (use the Code tags) and explaining better.
I had to read 4 times your sentence (specially the part with "hexa decimal value" and "an alphanumeric value"),
When I realized maybe you received a "USAGE COMP" value (to use COBOL language) and want it converted to "USAGE DISPLAY".
But then, what about the encoding ?
Why do I have to guess ? |
|
Back to top |
|
|
Sathiyendran
New User
Joined: 17 Jul 2015 Posts: 5 Location: India
|
|
|
|
Per Qmgr - Encoding is 273 and Coded Char Set is 819 displayed in the message (webMethod writes this data) - total length is 174 bytes output.
Code: |
01 WS-REPLY-MQ-RECORD.
05 RTRN-C PIC 9(04).
05 RFRNC-NO PIC X(06).
05 CNTC-TPC-SEQ-NO PIC 9(04).
05 W-MSG-FLD-X PIC X(40).
05 W-MSG-FLD-X-2 PIC X(40).
05 W-MSG-FLD-X-3 PIC X(40).
05 W-MSG-FLD-X-4 PIC X(40).
COMPUTE MQGMO-OPTIONS = MQGMO-SYNCPOINT +
MQGMO-WAIT +
MQGMO-FAIL-IF-QUIESCING
COMPUTE MQGMO-MATCHOPTIONS = MQMO-MATCH-CORREL-ID
MOVE MQMI-NONE TO MQMD-MSGID OF
MQ-TCS-MSG-DESCRIPTOR
MOVE WS-MSG-ID TO MQMD-CORRELID OF
MQ-TCS-MSG-DESCRIPTOR
MOVE MQ-WAIT-INTERVAL TO MQGMO-WAITINTERVAL
MOVE MQ-TCS-BUFFER-LENGTH TO MQ-TCS-MESSAGE-LENGTH
MOVE SPACES TO MQ-TCS-MESSAGE-DATA
*
CALL 'MQGET'
USING MQ-TCS-HCONN,
MQ-TCS-Q-HANDLE,
MQ-TCS-MSG-DESCRIPTOR,
MQ-GET-OPTIONS,
MQ-TCS-BUFFER-LENGTH,
MQ-TCS-MESSAGE-DATA,
MQ-TCS-MESSAGE-LENGTH,
MQ-TCS-COMPLETION-CODE,
MQ-TCS-REASON
IF MQ-TCS-REASON = MQRC-NONE AND
MQ-TCS-COMPLETION-CODE = MQCC-OK
MOVE MQ-TCS-MESSAGE-DATA TO WS-REPLY-MQ-RECORD
END-IF.
|
Output Data - After MQGET
Code: |
01 MQ-TCS-MESSAGE-DATA GROUP(10500)
02 MQ-MESSAGE-BYTE(1) PIC X(01) .
02 MQ-MESSAGE-BYTE(2) PIC X(01) .
02 MQ-MESSAGE-BYTE(3) PIC X(01) .
02 MQ-MESSAGE-BYTE(4) PIC X(01) .
02 MQ-MESSAGE-BYTE(5) PIC X(01) .
02 MQ-MESSAGE-BYTE(6) PIC X(01) .
02 MQ-MESSAGE-BYTE(7) PIC X(01) +
02 MQ-MESSAGE-BYTE(8) PIC X(01) .
02 MQ-MESSAGE-BYTE(9) PIC X(01) .
02 MQ-MESSAGE-BYTE(10) PIC X(01) .
02 MQ-MESSAGE-BYTE(11) PIC X(01) .
02 MQ-MESSAGE-BYTE(12) PIC X(01) .
02 MQ-MESSAGE-BYTE(13) PIC X(01) .
02 MQ-MESSAGE-BYTE(14) PIC X(01) .
02 MQ-MESSAGE-BYTE(15) PIC X(01) .
02 MQ-MESSAGE-BYTE(16) PIC X(01) .
02 MQ-MESSAGE-BYTE(17) PIC X(01) .
02 MQ-MESSAGE-BYTE(18) PIC X(01) . |
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
You were asked to use the code tags when presenting you/data/code. You were even given a link to how to use them. Please use them in future for anything that you might see on 3279 screen. I have coded your code for you - this time. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Try adding MQGMO_CONVERT to MQGMO_OPTIONS:
IBM Knowledge Center wrote: |
This option converts the application data in the message to conform to the CodedCharSetId and Encoding values specified in the MsgDesc parameter on the MQGET call. The data is converted before it is copied to the Buffer parameter. |
|
|
Back to top |
|
|
haroldo
New User
Joined: 13 Nov 2018 Posts: 2 Location: Chile
|
|
|
|
There are two funcions included in Z/OS ICSF that convert byte to hex display and viceversa
Look CSNBXBC and CSNBXCB functions
regards
PS. Very old thead but can be useful to anyone |
|
Back to top |
|
|
|