View previous topic :: View next topic
|
Author |
Message |
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
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 |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
Sorry , I am not able to understand what your are saying? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
(Java ) Source application put the message in windows format. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
Back to top |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
Yes, same only.
I have tried with UTF8 also. same problem |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
Hi,
thanks for all your help. I am beginner of Websphere MQ. The above information helps me lot. |
|
Back to top |
|
|
Thamilselvi
New User
Joined: 22 Jun 2012 Posts: 57 Location: Chennai
|
|
|
|
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 |
|
|
|