Wednesday, August 19, 2015

IBM - InfoSphere DataStage Xml Pack(XML Input)

IBM Info sphere Datastage provides three different stages to read,write and transform xml data.Below are the 3 stages available to perform the above mentioned operations.
  • XML Input
  • XML Output
  • XML Transformer
Below we are going to look about XML Input stage.
XML Input Stage :
Xml Input stage can read and validate input xml against provided xsd in schemalocation attribute value.In case of non availability of xsd it will not be able to read your xml data at all.So make sure you have a valid path and file or else simply not to have it at all.
You can read xml data through External source stage or sequential file stage and then source it to XML input stage to make it tabular data. In order to do that you need to provide the valid name space declarations available in your input xmls in transformations/stage tab of xml input stage. Under input tab specify what is your type of input whether it is file or column, based on the option you decide to choose under input tab use appropriate commands in external source stage. For either of the options provide appropriate values like column name or file path accordingly.
Under Output tab of Xml input stage you need to specify the columns you want to extract and their corresponding XPATH.In order to make this thing simple import your xsd of input file using XML Table Definition under Table Definitions of Import Menu. Load the schema you imported using Imported operation to output tabs schema which will also load all the information required with XPATH too.

Below is the sample job :


External Source stage:

As mentioned above select appropriate command in here based on option you are going to choose in xml stage.


Output Tab of External Source stage:



XML Input Stage :

If you already reading data in ESS stage then choose XML document else if you are reading filename with path then choose other.

Input Tab:


Output Tab:


0 comments:

 

Datastage Doctrina Copyright © 2011 -- Template created by O Pregador -- Powered by Blogger

Receive all updates, tips and tricks via Facebook. Just Click the Like Button Below