IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Message received hexa decimal format- data conversion in MQ


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sathiyendran

New User


Joined: 17 Jul 2015
Posts: 5
Location: India

PostPosted: Sat Sep 05, 2015 3:38 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Sep 07, 2015 10:42 am
Reply with quote

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
View user's profile Send private message
Sathiyendran

New User


Joined: 17 Jul 2015
Posts: 5
Location: India

PostPosted: Mon Sep 07, 2015 8:07 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Sep 07, 2015 9:26 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Sep 13, 2015 11:59 am
Reply with quote

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
View user's profile Send private message
haroldo

New User


Joined: 13 Nov 2018
Posts: 2
Location: Chile

PostPosted: Fri Feb 08, 2019 8:43 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top