Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Message received hexa decimal format- data conversion in MQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: Message received hexa decimal format- data conversion in MQ
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: 1219
Location: Israel

PostPosted: Mon Sep 07, 2015 10:42 am    Post subject: Reply to: Message received hexa decimal format- data conversion in MQ
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    Post subject:
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: 1715
Location: UK

PostPosted: Mon Sep 07, 2015 9:26 pm    Post subject:
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: 1219
Location: Israel

PostPosted: Sun Sep 13, 2015 11:59 am    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us