In this article we will see how read XML file from server in Datastage with a scenario:
External Source stage used to read the XML file path stored. We can use unix commands to list or read files. This file path is used to convert data stored in XML file in tabular format. Let’s study these two stages in detail by implementing above scenario step by step.
External Source stage used to read the XML file path stored. We can use unix commands to list or read files. This file path is used to convert data stored in XML file in tabular format. Let’s study these two stages in detail by implementing above scenario step by step.
Step #1: Design your job structure like below.
Step #2: Double click on External_Source stage, following window will pop up.
Step #3: To read this file path we need to define metadata in Columns tab as shown below.
Step #4: To load above XML file we need to define Table Definitions first. Follow the following procedure to load XML Table Definition.
- Click Import -> Table Definition -> XML Table Definitions.
- XML Meta Data Importer window will pop up
- Open XML file through File -> Open -> Required XML File
- Column names will pop up.
- Drop down each column and check box against Text.
- For repetition Element we have to choose key column
- Save this as SampleXML.
Step #6: To load the XML table definition which we have created in Step #4.
To import metadata click on Load button at the bottom and load the XML table definition which we have saved earlier SampleXML
To import metadata click on Load button at the bottom and load the XML table definition which we have saved earlier SampleXML