ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Unable to get actual string of data from MQGET in Cobol

Post new topic  Reply to topic
 Unable to get actual string of data from MQGET in Cobol « View previous topic :: View next topic » 
Author Message
Sathiyendran
PostPosted: Mon Sep 07, 2015 6:38 am    Post subject: Unable to get actual string of data from MQGET in Cobol Reply with quote

Newbie

Joined: 17 Jul 2015
Posts: 5

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
zpat
PostPosted: Mon Sep 07, 2015 6:52 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

For code page issues try using MQGMO-CONVERT

In fact this option can be used in most cases and makes the MQ the cross-platform interface that it is supposed to be.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Sep 08, 2015 4:39 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Make sure WebMethods sends the right format data:
MQFMT_STRING and use the MQGMO_CONVERT option...as stated by zpat
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Unable to get actual string of data from MQGET in Cobol
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.