Search code examples
xml-parsingdb2datastage

How to convert Db2 query result set to an XML file based on a given XSL using IBM DataStage?


Trying to covert a Db2 query result set to an xml file based on xsl. Can we use the below pattern?

DB2 Connector -> XML_Transformer Stage (imported xsl) - XML _Output Stage.

Thanks...R


Solution

  • There are multiple options assuming you do not have XML already in your Db2 table, you do not need the XML Transformer.

    I strongly suggest you use the modern Hierarchical stage (also known as XML stage depending on the version of DataStage) so I would go for following structure if you want a file or files as a target.

    Db2 Connect -> Hierarchical stage -> Sequential File stage

    In addition, Db2 offers lots of XML functionality to generate XML by using SQL or XQuery.