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
 

 

Getting junk values while browse the message from MQ

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: Getting junk values while browse the message from MQ
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jul 03, 2012 2:24 pm    Post subject: Reply to: Getting junk values while browse the message from
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jul 03, 2012 2:33 pm    Post subject: Reply to: Getting junk values while browse the message from
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

Moderator


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

PostPosted: Tue Jul 03, 2012 2:41 pm    Post subject:
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    Post subject:
Reply with quote

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

Moderator


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

PostPosted: Tue Jul 03, 2012 2:55 pm    Post subject:
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    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Jul 03, 2012 5:04 pm    Post subject:
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jul 04, 2012 4:00 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1219
Location: Israel

PostPosted: Wed Jul 04, 2012 7:38 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts How to show message using batch jobs madprasy TSO/ISPF 7 Fri Sep 09, 2016 6:55 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


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