ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » ASCII to EBCDIC conversion

Post new topic  Reply to topic
 ASCII to EBCDIC conversion « View previous topic :: View next topic » 
Author Message
rpm08
PostPosted: Mon Apr 07, 2008 9:16 am    Post subject: ASCII to EBCDIC conversion Reply with quote

Newbie

Joined: 02 Apr 2008
Posts: 5

Hi

i want to convert correlation id from ASCII to EBCDIC.

plz help me
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 07, 2008 9:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

CorrelationID is a BYTE field.

It is neither in ASCII nor in EBCDIC.

DO NOT try to pretend otherwise.

EDIT: This is why I told you You need to understand the difference between bytes and characters. .
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
rpm08
PostPosted: Mon Apr 07, 2008 10:04 am    Post subject: ASCII to EBCDIC conversion Reply with quote

Newbie

Joined: 02 Apr 2008
Posts: 5

tell me how to convert ASCII to EBCDIC?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 07, 2008 10:09 am    Post subject: Reply with quote

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
View user's profile Send private message
rpm08
PostPosted: Mon Apr 07, 2008 10:32 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 07, 2008 10:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981


_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Apr 07, 2008 11:01 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
jefflowrey
PostPosted: Mon Apr 07, 2008 11:03 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Mon Apr 07, 2008 11:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Mon Apr 07, 2008 12:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 08, 2008 6:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » ASCII to EBCDIC conversion
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.