4 Replies Latest reply on Sep 21, 2019 11:08 AM by Nico Heinze

    How to: convert .dat to XML

    victor mg New Member

      Hi everyone! I´m new here.

       

      Im working with PowerCenter 9.1.0. , I need to convert information .dat to xml, but  it does haven´t a homogeneous structure.

       

      I Know the xml output structure, the input information come informed or not. It´s possible?

       

      thank you!

        • 1. Re: How to: convert .dat to XML
          Nico Heinze Guru

          How to achieve this depends on the file structure of the .dat file. Is this a text file in CSV structure (what PowerCenter expects)? If so, you can simply source that .dat file and use a XML Target in your mapping to "translate" the file contents into a XML structure.

          For other purposes other measures must be taken, but you will need a XML target (or a so-called Midstream XML Generator transformation, that's more or less the same except that you need a different target for that mapping).

           

          Regards,

          Nico

          • 2. Re: How to: convert .dat to XML
            victor mg New Member

            Thank you for you reply!

            I have to read data from several csc files and generate an xml nesting data. would it be possible to achieve it whit midstream xml transformations?

             

            regards

            • 3. Re: How to: convert .dat to XML
              victor mg New Member

              I made a test, but I can't nest the data in file 1 and file 2. Is it possible?

              • 4. Re: How to: convert .dat to XML
                Nico Heinze Guru

                Yes, that is possible. But you have to create some key values which are used in both XML part, part 1 and part 2. Meaning that in one part these key values will be "primary keys" of the entities you refer to, and in the other parts of the XML hierarchy these key values will be referenced like "foreign keys".

                 

                May I suggest that you work through the respective chapters of the respective chapters in the Transformation Guide and the Designer Guide, once for XML Target Definitions, once for Midstream XML Generator transformations. The examples there should clarify what this "primary / foreign key" means.

                 

                Regards,

                Nico