XML File Special Character Issue

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Maharaj
Participant
Posts: 13
Joined: Tue Feb 03, 2004 3:50 pm

XML File Special Character Issue

Post 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
:(
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply