Author |
Message
|
vijsam |
Posted: Tue Jun 21, 2011 10:38 pm Post subject: replace special characters in input |
|
|
Apprentice
Joined: 01 Jun 2011 Posts: 46
|
Hello All,
Iam receiving ö special characters in input files,so when i try to pick them using blob then it fails with 2135 : Unconvertable character.when i try to replace them with SET BLOBInput = REPLACE(BLOBInput,X'1f'); iam facing error with 2590 : String is not of correct form for byte array. Must have even number of characters.....Please help
ThanksIn Advance.. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 22, 2011 2:06 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
when i try to pick them using blob then it fails with 2135 : Unconvertable character |
You are treating it as a character string, not as a BLOB. If you were treating the input as BLOB it would not be trying to convert it to characters.
Quote: |
when i try to replace them with SET BLOBInput = REPLACE(BLOBInput,X'1f'); iam facing error with 2590 |
Why are you trying to replace these characters? Are you sure that the input CodedCharSetId is correct? |
|
Back to top |
|
 |
vijsam |
Posted: Wed Jun 22, 2011 2:51 am Post subject: replace special characters in input |
|
|
Apprentice
Joined: 01 Jun 2011 Posts: 46
|
yes.... I want replace the special charcters......in the input file and iam setting the correct ccsid. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 22, 2011 3:10 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
vijsam |
Posted: Wed Jun 22, 2011 3:20 am Post subject: |
|
|
Apprentice
Joined: 01 Jun 2011 Posts: 46
|
ya i have tried with X '1F' too...any suggestions plzzz |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jun 22, 2011 7:03 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
in the input file and iam setting the correct ccsid |
If the ccsid is correct then why are you getting the 'Unconvertable character' error? |
|
Back to top |
|
 |
vijsam |
Posted: Wed Jun 22, 2011 11:00 pm Post subject: |
|
|
Apprentice
Joined: 01 Jun 2011 Posts: 46
|
i used SET BLOBvalue=CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.Properties.CodedCharSetId Encoding InputRoot.Properties.Encoding);....I hope this works right for CCSID. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 23, 2011 12:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
If that code caused the unconvertable character error then either
a) the CCSID on the input node is wrong
or
b) the sender is sending bad data.
In other words, I'm not (yet) convinced that simply removing these 'bad' characters is the correct solution. It might be the right thing to do, but it might not. |
|
Back to top |
|
 |
vijsam |
Posted: Thu Jun 23, 2011 1:18 am Post subject: |
|
|
Apprentice
Joined: 01 Jun 2011 Posts: 46
|
any suggestions Kimbert.........Plz.....any valuable inputs....from ur side.... |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 23, 2011 1:28 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
- What is the CCSID?
- Why does the input data cause an error when you convert it to that CCSID? |
|
Back to top |
|
 |
vijsam |
Posted: Thu Jun 23, 2011 2:09 am Post subject: |
|
|
Apprentice
Joined: 01 Jun 2011 Posts: 46
|
The input data is causing problems as there are special characters in it and we have to accept them anyways.... |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 23, 2011 2:19 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You are getting Unconvertible character errors because, exactly and only, the characters in the input message DO NOT MATCH the CCSID of the message itself.
That is exactly and only the reason for this error.
This is *always* the fault of the sending application.
If you cannot change the sending application - and this should be the first thing you try to do and you should not give up on this easily - then you need to stop trying to read the input message as CHARACTERS and start trying to read it as BYTES and then "fix" the "special" characters by replacing their bytes with other bytes. Then, when you *know* the message actually matches the CCSID, you can treat the message as characters again. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 23, 2011 2:54 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
The input data is causing problems as there are special characters in it |
I do not know what you mean when you say 'special character'?
IF the CCSID in the FileInput node has been set correctly
AND the sender has not made a mistake
THEN all of the characters will be converted successfully.
So...please explain, in detail, why you cannot handle a 'special character'. |
|
Back to top |
|
 |
vijsam |
Posted: Thu Jun 23, 2011 4:05 am Post subject: |
|
|
Apprentice
Joined: 01 Jun 2011 Posts: 46
|
If we set SET BLOBvalue=CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.Properties.CodedCharSetId Encoding InputRoot.Properties.Encoding),then will there be any difference in CCSID??what ever ll be the CCSID in the input file ,it will be coming to the value right??? correct me if iam wrong...and special character example:ä ö |
|
Back to top |
|
 |
kimbert |
Posted: Thu Jun 23, 2011 4:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
what ever ll be the CCSID in the input file ,it will be coming to the value right??? |
No. You are making a wrong assumption. You are probably assuming that FileInput works exactly like MQInput. It doesn't:
MQ:
If the message contains text data, then the CCSID of the text data is specified in MQMD.CodedCharSetId. The MQInput node automatically copies InputRoot.MQMD.CodedCharSetId to InputRoot.Properties.CodedCharSetId.
File
A file does not have any way of specifying the CCSID of its contents. That is why the FileInput node offers the 'Message Coded Character Set Id' property. You may have set that property to the wrong value.
See http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ac55150_.htm#ac55150_tmp |
|
Back to top |
|
 |
|