Tuesday, June 7, 2011

Dynamically Changing Flatfile Name

How to change Target file name with session run time

If your Infa is 8.x later ver.. then you can go ahead as Swetha suggested..
> Add 'FileName' port to your target definition as a new port.
> and set  the Date Format setting for that Port in Properties..
> You can Derive one o/p port in Exp-tr with correct datatype and precision
> O_FileName :  'Tgt_File_'||TO_CHAR(SESSSTARTTIME,'DD/MM/YYYY HH24:MI')||'.csv'
Here Instead of using  'Sysdate' better to use SESSSTARTTIME .

Another way is....

> In the Workflow create a Workflow variable $$Se_End_Time
> In the Data Flow.. create Session task and Assignment Task .. and connect them
> In the assignment task / Expressions /
$$Se_End_Time   =  TO_CHAR($Session_Name.EndTime,'DD-MM-YYYY')

> Create a Parameter file

In the above file ..
> $$Se_End_Time is the Workflow variable....

In the Session Properties...
> Output FileName :  $FileName$DatePart .csv
> and set the parameter file path ...

-- Ram


  1. Informatica Online Training | Informatica Online Training in India Hyderabad | Best Informatica Online Training
    Informatica Online Training I have taken this course from Attain Technologies. Thay covered all the real time scenarios and their training way was very good approach is very much understandable
    Contact them on given contact number is +91 9052820000, +1 2092073642, Email:contact@attainonlinetraining.com
    Web: http://attainonlinetraining.com/it-informatica-online-training.html

  2. Thanks for providing the best information it's very useful for INFORMATICA learners.we also provide the bestINFORMATICA Online Training.

  3. I actually enjoyed reading through this posting. Thanks for your posting , which helped me to join Informatica online training @ www.123Trainings.com