Author |
Message
|
wmq_guy |
Posted: Thu Oct 21, 2004 10:39 am Post subject: Ebcdic to Ascii sample |
|
|
Acolyte
Joined: 21 Oct 2004 Posts: 50
|
I looked at some other posts on this subject, but did not come away with what I needed.
Although MQ has the ability to convert a message that was sent from os400 to windows, I have been instructed not to use this functionality...
what are the necesssary steps to achieve this?
Last edited by wmq_guy on Tue Oct 26, 2004 1:38 pm; edited 2 times in total |
|
Back to top |
|
 |
nathanw |
Posted: Thu Oct 21, 2004 10:41 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
easy question
why have you been told not to use it? |
|
Back to top |
|
 |
EddieA |
Posted: Thu Oct 21, 2004 10:59 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
what are the necesssary steps to achieve this |
Ensure your message is all "character" data. Use MQSTR as the Format. Make sure the GET has GET_WITH_CONVERT.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
wmq_guy |
Posted: Thu Oct 21, 2004 11:16 am Post subject: |
|
|
Acolyte
Joined: 21 Oct 2004 Posts: 50
|
I would like to use the MQ_STR and convert, but as I said..it's not an option because all the data is not char.. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Oct 21, 2004 11:24 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
If the data isn't all character, then don't use MQSTR. MQSTR tells WMQ what kind of data is in the message so that it can convert it. It sounds like you need to supply your own format and then a conversion exit to convert the data. |
|
Back to top |
|
 |
wmq_guy |
Posted: Thu Oct 21, 2004 11:37 am Post subject: |
|
|
Acolyte
Joined: 21 Oct 2004 Posts: 50
|
I apologize, but I am completely confused by your answer.
A conversion exit? Can you elaborate?
It is hard to imagine I would be the first person to try this.
thank you kindly |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Oct 21, 2004 12:45 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Sorry about that. I should have given more info. Your interested in Chapter 11 of the Application Programming Guide. Basically, you fill in the MQMD Format with the name of your exit. You then write this exit (a sample skeleton is provided). When WMQ gets a message, it looks at the Format and then calls your routine to convert the data.
To be honest, I've known some people that feel like it is better to just convert their data to be all character, use MQSTR, and let WMQ do the converting. This probably depends on how much non-character data you are trying to send. |
|
Back to top |
|
 |
kirani |
Posted: Thu Oct 21, 2004 10:32 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
wmq_guy wrote: |
I would like to use the MQ_STR and convert, but as I said..it's not an option because all the data is not char.. |
Can you explain what do you mean by non-char data? Where is your sending application residing? By non-char fields we are referring to BINARY data, for example, COMP-3 fields on M/F. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Nigelg |
Posted: Thu Oct 21, 2004 11:50 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
If you want to do it programmatically yourself in C, you need to read up on the iconv_open() and iconv() library functions.
iconv_open() opens a converter, and iconv() converts the data.
The syntax is quite easy. |
|
Back to top |
|
 |
wmq_guy |
Posted: Fri Oct 22, 2004 11:55 am Post subject: |
|
|
Acolyte
Joined: 21 Oct 2004 Posts: 50
|
yes, binary data.
This tasks seems very daunting.
an MDB is pickup this ebcidic tran off a mq queue. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Oct 22, 2004 2:13 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Tell the MF app to move all those COMP-3s into PIC-9 fields, and then send the message with MQSTR in the format. This is the easiest way to solve this problem.
A regular MQGET with convert will then work just fine on that data on any other platform. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
wmq_guy |
Posted: Tue Oct 26, 2004 12:52 pm Post subject: |
|
|
Acolyte
Joined: 21 Oct 2004 Posts: 50
|
<edited>
check out the post below.
Last edited by wmq_guy on Tue Oct 26, 2004 1:36 pm; edited 1 time in total |
|
Back to top |
|
 |
EddieA |
Posted: Tue Oct 26, 2004 1:16 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
If your message contains any non-character data (binary integers, comp-3), then this code will scramble them just as effectively as MQSeries.
If the data is not character, then you have to translate it field by field knowing what kind of data each field is.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|