Topic
  • 9 replies
  • Latest Post - ‏2013-05-01T05:37:32Z by AKNaik
SystemAdmin
SystemAdmin
8523 Posts

Pinned topic Data conversion from EBCDIC

‏2013-04-03T05:54:04Z |
Hi all,

Am working on a system built using Java which fetches the data from WebSphere MQ. This data comes from DB2 Event Publisher intern into Mainframe queues and then into WebSphere MQ queues.

We started getting issue with format of the data which is coming to the application for example instead of space we are getting 40, which EBCDIC representation of blank/space. so conversion from EBCDIC is not happening here.

can someone help as who should be responsible for this conversion is it MQ/EP/Java ?

Thanks in Advance.
Updated on 2013-04-05T06:21:35Z at 2013-04-05T06:21:35Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-03T22:34:27Z  
    It is the responsibility of the consuming app to request MQ to convert a message to the apps CCSID (MQGMO_CONVERT option in most procedural languages).

    It is the responsibility of the producing app to set the message format to STRING and ensure the message CCSID is correct (the default is usually OK) and ensure the message data payload only contains valid characters for the CCSID, which MQ can successfully convert into the consumer's CCSID.

    HTH, G.
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-04T14:06:24Z  
    It is the responsibility of the consuming app to request MQ to convert a message to the apps CCSID (MQGMO_CONVERT option in most procedural languages).

    It is the responsibility of the producing app to set the message format to STRING and ensure the message CCSID is correct (the default is usually OK) and ensure the message data payload only contains valid characters for the CCSID, which MQ can successfully convert into the consumer's CCSID.

    HTH, G.
    Hi GBaddeley,

    Thanks for replying. Am confused here with CCSID !! thing is... does setting the message format and setting the CCSID at both source and destination Queue Managers is enough? or any other parameter we need to set?
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-05T01:18:27Z  
    Hi GBaddeley,

    Thanks for replying. Am confused here with CCSID !! thing is... does setting the message format and setting the CCSID at both source and destination Queue Managers is enough? or any other parameter we need to set?
    Unless you have a specific design requirement, normally you don't need to set CCSID on the Queue Manager or CodedCharSetId in Message Descriptors. The default values should work OK for the vast majority of application designs.

    However, if you are messaging across different platforms, it is worthwhile knowing what these are, and know to avoid any weird character codes (ie. non-printable characters) that can't be converted by MQ.
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-05T03:23:42Z  
    Unless you have a specific design requirement, normally you don't need to set CCSID on the Queue Manager or CodedCharSetId in Message Descriptors. The default values should work OK for the vast majority of application designs.

    However, if you are messaging across different platforms, it is worthwhile knowing what these are, and know to avoid any weird character codes (ie. non-printable characters) that can't be converted by MQ.
    okay, see the data which is coming is like this in place of SPACE we are getting 40 and for 1234 its shows F1F2F3F4.

    the flow of the data is -

    DB2 Event publisher publishes this data into Mainframe queue then intern it goes to remote MQ queues. And Java application in JMS reads it. It was working fine earlier but we started facing this issue not sure what caused this

    We are using WebSphere MQ V6.0.2.11. At client QManager (where Application is reading from) CCSID is 1208. And channel parameter CONVERT at source is set NO.

    And with same settings it was working fine earlier!! not sure what went wrong!!
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-05T06:21:35Z  
    okay, see the data which is coming is like this in place of SPACE we are getting 40 and for 1234 its shows F1F2F3F4.

    the flow of the data is -

    DB2 Event publisher publishes this data into Mainframe queue then intern it goes to remote MQ queues. And Java application in JMS reads it. It was working fine earlier but we started facing this issue not sure what caused this

    We are using WebSphere MQ V6.0.2.11. At client QManager (where Application is reading from) CCSID is 1208. And channel parameter CONVERT at source is set NO.

    And with same settings it was working fine earlier!! not sure what went wrong!!
    >see the data which is coming is like this in place of SPACE we are getting 40 and for 1234 its shows F1F2F3F4.

    k, that's EBCDIC.

    Looking at messages on the queue (eg, using MQ Explorer) can you see the Message Descriptor as well? What is the Format field set to? (expecting MQHRF2 or MQSTR) What is the CodedCharSetId set to? (expecting an EBCIDC ccsid, such as 37 or 500)

    HTH, G.
  • AKNaik
    AKNaik
    2 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-16T13:27:06Z  
    >see the data which is coming is like this in place of SPACE we are getting 40 and for 1234 its shows F1F2F3F4.

    k, that's EBCDIC.

    Looking at messages on the queue (eg, using MQ Explorer) can you see the Message Descriptor as well? What is the Format field set to? (expecting MQHRF2 or MQSTR) What is the CodedCharSetId set to? (expecting an EBCIDC ccsid, such as 37 or 500)

    HTH, G.

    Hi GBaddeley,

    is there any MQI command to check Message Descriptor ?

    the CodedCharSetId at source QManager is set to 37.

    Not sure how to check the Message Descriptor here.. As i said with same settings it was working fine.. could there be any bug?

    or Java (Application) should do this conversion? confused here :(

  • Morag Hughson
    Morag Hughson
    140 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-18T17:26:43Z  
    • AKNaik
    • ‏2013-04-16T13:27:06Z

    Hi GBaddeley,

    is there any MQI command to check Message Descriptor ?

    the CodedCharSetId at source QManager is set to 37.

    Not sure how to check the Message Descriptor here.. As i said with same settings it was working fine.. could there be any bug?

    or Java (Application) should do this conversion? confused here :(

    I'm going to try to summarise all the pieces here to hopeful solve your confusion.

    The created message

    When a message is create (MQPUT) it should contain a Format and a CCSID. As noted earlier, usually the default CCSID works just fine unless you have an application which is running with a different CCSID than the data it is producing. So the really important part is the Format. The default there is a blank Format field which means "binary" and "binary" means no conversion will ever happen. In order to check the Format of the message on your queue, you can do that with the MQ Explorer Selecting Browse Messages from MQ Explorerby selecting "Browse Messages.." from the right-click context menu on the queue, and then look for the Format column. The Format is shown in the Message BrowserSee attached pictures. Make sure it is non-blank.

    Getting the message

    When a message is retrieve (MQGET), the getting application must indicate a wish to convert the message (MQGMO_CONVERT) and a CCSID to convert it into. As noted earlier, usually the default CCSID works just fine unless you have an application that is running with a different CCSID than it wishes to read the data in. So the really important part here is the MQGMO option. If your message looked OK when MQPUT, and you suspect your getting application might have something in error, try running amqsget which does request MQGMO_CONVERT and prove that the message is set up ready to convert.

    Updated on 2013-04-18T17:30:48Z at 2013-04-18T17:30:48Z by Morag Hughson
  • fjb_saper
    fjb_saper
    196 Posts

    Re: Data conversion from EBCDIC

    ‏2013-04-19T16:13:14Z  

    It may also depend on the version of your MQ/JMS Client. Make sure to have the latest version...or something above V7.0.1.6

  • AKNaik
    AKNaik
    2 Posts

    Re: Data conversion from EBCDIC

    ‏2013-05-01T05:37:32Z  
    • fjb_saper
    • ‏2013-04-19T16:13:14Z

    It may also depend on the version of your MQ/JMS Client. Make sure to have the latest version...or something above V7.0.1.6

    @Morag, Thanks for the explanation. It's pretty clear to me now.

    @fjb_saper,

    We are using MQ v6.0.2.11.

    We will check these parameters using amqsbcg. will update the same.

    Updated on 2013-05-01T05:38:17Z at 2013-05-01T05:38:17Z by AKNaik