Change Your Target XML File Name Dynamically
Just like creating flat files with dynamic file name, you might get requirements to generate XML output files with dynamic name. In this article lets see an easy method to generate XML output files with dynamically changing name.

Lets directly jump into the mapping development.

As the first step lets open the target XML definition in the target designer. Double click the XML definition to open it in the XML editor.

XML Editor opens as shown in below image.
XML Editon in Informatica PowerCenter
Click and highlight the root node(X_cus_customerinfo) of the XML definition. Go to the menu XML Views and click on Create FileName Column as shown below. This will create an additional column in the XML target definition.
XML Editon in Informatica PowerCenter
Save and close the XML Editor. You will see the FileName port is created in the XML Target definition as in below image.
XML target definition in Informatica PowerCenter
Build your mapping with an expression transformation as shown in below image to generate the dynamic file name. Map the column from the expression transformation to FileName port in XML Target definition.

Hint : In below mapping example, XML file name is dynamically changed based on the Customer STATE. The output file names will be like CA.XML, NY.XML, NJ.XML...
Now Create the workflow, not any special setting is required at the session or workflow level.
Note : You can leave the Output Filename session property with the default value.

Hope you enjoyed this tutorial and is helpful. Please leave you questions and commends, I will be more than happy to help you.

Share with your friends

Readers Comments