Page 1 of 1

XML File Special Character Issue

Posted: Fri Feb 20, 2004 11:39 am
by Maharaj
Iam having special characters(&,<,>,..) in my data extracted from the source (DB2 database). Iam using a DB2 stage for this . I want to remove this special characters and control characters if any during the extraction from the source and before the creation of the XML File. Iam using a XMLWriter for creating the XML File. Is there any provision in DataStage to control these special characters during the extraction of data from the source.

Thanks
Maharaj
:(

Posted: Sat Feb 21, 2004 4:32 pm
by ray.wurlod
You could always use the Ereplace function in a Transformer stage, or in a Routine called from a Transformer stage. For example

Code: Select all

Ereplace(inlink.column, "<", "&LT;", -1, 0)
Unfortunately, this approach requires one Ereplace per special character. But, if there aren't many of these, it ought not to be too great a burden.