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

Getting junk values while browse the message from MQ


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

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Tue Jul 03, 2012 2:10 pm
Reply with quote

Hi,

I have coded a cobol cics program to browse the message in mainframe MQ. My program getting the some junk characters while browsing the message from MQ.

COMPUTE MQGMO-OPTIONS = MQGMO-NO-WAIT +
MQGMO-ACCEPT-TRUNCATED-MSG +
MQGMO-CONVERT +
MQGMO-FAIL-IF-QUIESCING.

MOVE MQMI-NONE TO MQMD-MSGID
MOVE MQFMT_NONE TO MQMD-FORMAT
MOVE MQCI-NONE TO MQMD-CORRELID
MOVE MQENC-NATIVE TO MQMD-ENCODING
MOVE MQCCSI-Q-MGR TO MQMD-CODEDCHARSETID

CALL 'MQGET' USING W03-HCONN
W03-HOBJ
MQMD
MQGMO
W00-MSGLENGTH
W00-MSGBUFFER
W00-DATALENGTH
W03-COMPCODE
W03-REASON

Please help me how to get message in mainframe supported format from MQ.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Jul 03, 2012 2:24 pm
Reply with quote

Quote:
My program getting the some junk characters while browsing the message from MQ.


depending on the partners involved in the <message exchange> what You see as garbage could be easily binary data ( COBOL COMP stuff for example )

MQ is just a carrier whose task is to deliver the <message> data,
the message content is established by the application conventions.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Tue Jul 03, 2012 2:28 pm
Reply with quote

Sorry , I am not able to understand what your are saying?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Jul 03, 2012 2:33 pm
Reply with quote

Quote:
Sorry , I am not able to understand what your are saying?

well, I thought I gave a very simple explanation ...
if You cannot understand it, we are all wasting time

I do not see any way of explaining it in simpler terms.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jul 03, 2012 2:41 pm
Reply with quote

Try to browse through your input queue and try to understand in what format the source application has used to place the message to queue

May be MQMD-FORMAT
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Tue Jul 03, 2012 2:44 pm
Reply with quote

(Java ) Source application put the message in windows format.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jul 03, 2012 2:55 pm
Reply with quote

Isn't your doubt just duplicate of THIS POST
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Tue Jul 03, 2012 3:05 pm
Reply with quote

Yes, same only.
I have tried with UTF8 also. same problem
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 03, 2012 5:04 pm
Reply with quote

Thamilselvi, there is no such thing as "junk values" -- please go write that on a white board 1000 times (or 10000 times if that is what it takes) until you understand it.

A PC works in ASCII. A mainframe works in EBCDIC. Unless the characters are translated along the way from ASCII to EBCDIC, a PC message sent to a mainframe will not be readable and will have strange looking characters throughout. The easiest, and most likely, explanation for what you are seeing is that the data is not being translated to EBCDIC. And, by the way, UTF-8 is a version of ASCII and hence would show exactly the same problem. If this is the case, you must find a way in your application to do the translation or you'll continue to have problems. Many times, this translation is done by the transfer software (using FTP to send a text file from a PC to a mainframe, for example, converts the ASCII to EBCDIC during the FTP).

There are other possibilities -- for example, the data might be all numeric data and the mainframe storage format is so alien to you that you don't recognize the data. Unless you post sample data (preferably using the Code button to preserve spacing) in hexadecimal, there's no way we can help you more.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Wed Jul 04, 2012 1:56 pm
Reply with quote

Hi,

I have convert the ASCII data to EBCDIC format. But, the unused spaces are display as below. I have initialized all used variables. Eventhough , I am getting the MQ message(after conversion ) as below. Can any one help me to sought this.

<CUSTOMER-DETAILS><CUSTOMER-NAME><FIRSTNAME>THAMILSELVI</FIRSTNAME><LASTNAME>SUR
ESHKUMAR</LASTNAME></CUSTOMER-NAME><ADDRESS-DETAILS><CITY>CHENNAI</CITY><STATE>T
AMILNADU</STATE></ADDRESS-DETAILS></CUSTOMER-DETAILS>@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Jul 04, 2012 4:00 pm
Reply with quote

If the source of the message is a Java application, you are most likely seeing a JMS header. This is contained in an MQ RFH2 (iirc) and you need to allow for this in your Cobol program. Alternatively, it is possible for the Java-end to specify that the RFH2 is not to be present.

Garry.
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Wed Jul 04, 2012 6:30 pm
Reply with quote

Code:
<CUSTOMER-DETAILS>
   <CUSTOMER-NAME>
      <FIRSTNAME>THAMILSELVI
      </FIRSTNAME>
      <LASTNAME>SURESHKUMAR
      </LASTNAME>
   </CUSTOMER-NAME>
   <ADDRESS-DETAILS>
      <CITY>CHENNAI
      </CITY>
      <STATE>TAMILNADU
      </STATE>
   </ADDRESS-DETAILS>
</CUSTOMER-DETAILS>

What are you expecting more ?
It would be much easier to debug if you know whats missing.
To me it looks as it is a perfekt XML-structure, with some extra garbage.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 04, 2012 7:05 pm
Reply with quote

mq messages are all variable length - they all come with message length attribute populated at time of get.

that means any data beyond the 'length' is not to be considered.

you have a buffer length, which is the length of an area whose address you provide mqs on the get(or put)
within the 'buffer' is the message, and for a put, the length of the message in the buffer must be calculated by the sending application.

conversely, a get will receive a message into the 'buffer', and the message length will be provided by the 'get'.

this is a typical question by someone who has made no attempt to learn about or understand mqs.

actually, this thread would be a complete waste of time,
except that occasionally, we need reminders that there are
people out there in our profession who just don't understand sh*t.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jul 04, 2012 7:38 pm
Reply with quote

Thamilselvi wrote:
I have convert the ASCII data to EBCDIC format. But, the unused spaces are display as below. I have initialized all used variables. Eventhough , I am getting the MQ message(after conversion ) as below. Can any one help me to sought this.

<CUSTOMER-DETAILS><CUSTOMER-NAME><FIRSTNAME>THAMILSELVI</FIRSTNAME><LASTNAME>SUR
ESHKUMAR</LASTNAME></CUSTOMER-NAME><ADDRESS-DETAILS><CITY>CHENNAI</CITY><STATE>T
AMILNADU</STATE></ADDRESS-DETAILS></CUSTOMER-DETAILS>@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

I didn't understand how you did the "convert the ASCII data to EBCDIC format"
When you call MQGET, one of the parameters received is the actual message length.
Do you check this value ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 04, 2012 8:07 pm
Reply with quote

the @ are converted ebcidc spaces to ascii spaces.

the unused area of the buffer (in your program)
and by unused i mean that area beyond the message length

is not affected by mqs, actually, that is the way your storage
in your program
was initialized.
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Jul 05, 2012 4:24 pm
Reply with quote

Hi,

thanks for all your help. I am beginner of Websphere MQ. The above information helps me lot. icon_biggrin.gif
Back to top
View user's profile Send private message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Jul 05, 2012 4:27 pm
Reply with quote

Hi All,

Thanks for all your effort /help. the above information helps me to understand about to get message from MQ. Bcoz, you all only I have completed my program at on time.
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 HILITE on Browse mode? TSO/ISPF 2
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
This topic is locked: you cannot edit posts or make replies. how can I proof that message was post... Java & MQSeries 1
Search our Forums:

Back to Top