Author |
Message
|
namakkal |
Posted: Sun May 31, 2009 5:51 am Post subject: Doubt Regarding the special character conversion |
|
|
Novice
Joined: 06 Feb 2009 Posts: 19
|
Hi,
i have a doubt converting special char symbol into character by using BITSTREAM.
i am getting the unconvertable character error while try to convert special character to character( example. ® ...)
can any one please tell to how to solve this problem .
My code is like this
DECLARE bBitInputMsg BLOB ASBITSTREAM(OutputRoot.XMLNSC CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding);
DECLARE cCharInputMsg CHAR CAST (bBitInputMsg AS CHAR CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding);
First i am conveting the XML into BLOB then i am converting the BLOB to Character that time i am getting the Convertion error if the input messaeg have some special character. please help me on this .
Regards
Sathish |
|
Back to top |
|
 |
kimbert |
Posted: Sun May 31, 2009 12:48 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
What's the overall goal that you're trying to accomplish? |
|
Back to top |
|
 |
rekarm01 |
Posted: Sun May 31, 2009 3:21 pm Post subject: Re: Doubt Regarding the special character conversion |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
namakkal wrote: |
Code: |
DECLARE bBitInputMsg BLOB ASBITSTREAM(OutputRoot.XMLNSC CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding); |
|
'OutputRoot' should probably be 'InputRoot'. 'ENCODING' is harmless, but unnecessary for XMLNSC.
namakkal wrote: |
i am getting the unconvertable character error while try to convert special character to character( example. ® ...) |
Which error? Which code is generating the error? Be specific.
Which character encoding does the input header ccsid specify?
Which character encoding does the input body actually use?
Are these different?
kimbert wrote: |
What's the overall goal that you're trying to accomplish? |
|
|
Back to top |
|
 |
broker_new |
Posted: Sun May 31, 2009 6:29 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
I guess "namakkal" is trying to convert the input message to a string. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
namakkal |
Posted: Sun May 31, 2009 8:45 pm Post subject: Re: Doubt Regarding the special character conversion |
|
|
Novice
Joined: 06 Feb 2009 Posts: 19
|
rekarm01 wrote: |
namakkal wrote: |
Code: |
DECLARE bBitInputMsg BLOB ASBITSTREAM(OutputRoot.XMLNSC CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding); |
|
'OutputRoot' should probably be 'InputRoot'. 'ENCODING' is harmless, but unnecessary for XMLNSC.
namakkal wrote: |
i am getting the unconvertable character error while try to convert special character to character( example. ® ...) |
Which error? Which code is generating the error? Be specific.
Which character encoding does the input header ccsid specify?
Which character encoding does the input body actually use?
Are these different?
kimbert wrote: |
What's the overall goal that you're trying to accomplish? |
|
Hi ,
i am trying to convert the XMLNSC message into string but some arrtibutes having special character like (®). i could not able to convert the special char into character.
Regards
Sats |
|
Back to top |
|
 |
kimbert |
Posted: Mon Jun 01, 2009 12:50 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
i am trying to convert the XMLNSC message into string |
I guessed that...but why do you want to do this? There may be a better way to meet the requirement. |
|
Back to top |
|
 |
ein |
Posted: Tue Jun 09, 2009 9:32 pm Post subject: |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
kimbert wrote: |
Quote: |
i am trying to convert the XMLNSC message into string |
I guessed that...but why do you want to do this? There may be a better way to meet the requirement. |
Hello Kimbert,
What is the better way,
How we can archive this? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 09, 2009 11:53 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ein wrote: |
What is the better way, |
Answer the question and maybe we'll come up with something.
ein wrote: |
How we can archive this? |
Archive or Achieve?
If you're simply trying to archive a message, why convert it to a string?
If you're trying to achieve a goal to which converting XML to a string is a means to an end (and have the same issues with spelling that I do!) the question remains - why convert XML to a string like this? What is the requirement? What is the goal?
There may be a better way to achieve "the goal" than converting XML to string. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ein |
Posted: Wed Jun 10, 2009 3:25 am Post subject: |
|
|
Centurion
Joined: 14 Mar 2009 Posts: 108
|
Thanks for rply
I cud have tried with ASBITSTREAM ... what namakkal has mentioned. it was failed.
And Even I have my own solution i.e to send the actual message in environment variables.
I cud have archived the requirement. But I am looking for better solution than me.
You said that you have better solution. that way i have asked you.
Here is my requirement.
WTX is sending Data with special characters in XML format. WMB has to identify the some of the fields and send it to WPG in RFH2 header and read the actuall content which i have tried to read as string has some special characters.
Now you understood the requirement.
Now tell me what is your solution, if you know. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 10, 2009 4:04 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
You said that you have better solution. that way i have asked you. |
I don't think anybody said that. We suggested that there *might* be a better solution.
Quote: |
Here is my requirement.
WTX is sending Data with special characters in XML format. WMB has to identify the some of the fields and send it to WPG in RFH2 header and read the actuall content which i have tried to read as string has some special characters.
Now you understood the requirement. |
Sorry - I don't understand that. What is WPG? Why does WMB have to identify some of the fields? Who has to read this 'actual content' and why? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 10, 2009 4:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ein wrote: |
Now you understood the requirement. |
And thank you for the detailed explaination.
ein wrote: |
Now tell me what is your solution, if you know. |
Well I'll ask another question if I may - does the CCSID of the RFH2 support the special characters? If not, what drove that decision? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|