Author |
Message
|
rpm08 |
Posted: Mon Apr 07, 2008 9:16 am Post subject: ASCII to EBCDIC conversion |
|
|
Newbie
Joined: 02 Apr 2008 Posts: 5
|
Hi
i want to convert correlation id from ASCII to EBCDIC.
plz help me |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 07, 2008 9:19 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
rpm08 |
Posted: Mon Apr 07, 2008 10:04 am Post subject: ASCII to EBCDIC conversion |
|
|
Newbie
Joined: 02 Apr 2008 Posts: 5
|
tell me how to convert ASCII to EBCDIC? |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 07, 2008 10:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Do not put string data into a CorrelationID or a MessageID.
BECAUSE there will be no automatic conversion done, BECAUSE the messageID and CorrelationID fields are BYTE fields and not CHARACTER fields.
Otherwise, you have to write code to do this yourself.
You need to rethink whatever design has lead you to try to put character data into byte fields.
It is a very bad idea to do this! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
rpm08 |
Posted: Mon Apr 07, 2008 10:32 am Post subject: |
|
|
Newbie
Joined: 02 Apr 2008 Posts: 5
|
its not designed by me. its clients requirment.where they want to get correlation iD in EBCDIC format.
forget about correlation id just tell me how to convert ASCII --> EBCDIC and bytes --> EBCDIC in C#.net. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 07, 2008 10:38 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Mon Apr 07, 2008 11:01 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
rpm08 wrote: |
its not designed by me. its clients requirment.where they want to get correlation iD in EBCDIC format. |
Maybe you should point your client to mqseries.net..... |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Apr 07, 2008 11:03 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Thirdly, I found an exact answer to this with one google search.
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Apr 07, 2008 11:25 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
To summarize:
An MQBYTE field is 8-bits of no particular coding scheme. This means that the exact same 24 bytes leaves one platform, and arrives unchanged at another platform. MQBYTE fields are, therefore, platform-neutral.
CorrelId and MsgId are MQBYTE24 fields, 24 bytes long.
An MQBYTE field is not converted by MQ software.
As noted in this post, if you place data in byte fields, it is up to you (your application) to convert.
This is working to specifications. Read the WMQ Application Programing Reference, and WMQ Application Programming Guide. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Apr 07, 2008 12:37 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rpm08 wrote: |
its not designed by me. its clients requirment.where they want to get correlation iD in EBCDIC format. |
Your clients need to spend a lot more time learning about WMQ before specifying things. Or you need to push back as a) this is not going to work (for all the reasons specified) and b) it's a silly idea even if it did work
rpm08 wrote: |
forget about correlation id just tell me how to convert ASCII --> EBCDIC and bytes --> EBCDIC in C#.net. |
You can't convert anything that's not pure text using nothing but WMQ, so the EBCDIC & bytes is doomed. If all you want is ASCII <-> EBCDIC in pure text, look up "conversion" in the documentation. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Apr 08, 2008 6:09 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9472 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
it is up to you (your application) to convert |
As explained in this post, MQBYTE fields are not converted by WMQ - the bits remain unchanged.
If an application places 24 bytes of 8-bit ascii in one of those MQBYTE fields, YOUR APPLICATION can convert it to ebcdic.
Your application will need to build a table of ascii bytes (characters), and what the 8-bit ascii byte convert to in ebcdic. This is substantially what WMQ does when it converts MQCHAR fields.
A quick search by Mr. Google 'convert ascii to ebcdic' yielded about 30,200 hits. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|