How to generate target file with timestamp

In this scenario, we understand how to generate target file withtimestamp. And also to generate the header and footer with UNIX or Batch Command
1. Create the Target File Definition using the Target Designer (EMPLOYEE_FF)
Menu–>Targets–>Create—>Enter name and select Flat file from Drop Down.

imga (2)

Edit the Target Definition, in columns tab, right corner click on “F” to add file name
to the Target Definition. Also, select the delimiter as | in TABLE tab.
3. Add the expression transformation EXP_DEFAULT_FF in mapping created in
Scenario A ―m_ods_employee_types‖, pull all the columns from default group
4. Add an output port O_FILE_NAME in expression EXP_DEFAULT_FF.
O_FILE_NAME = ’employee_ff_’||TO_CHAR(SYSDATE,’ddmmyyyyhh24miss’)||’.txt’
5. Drag the Target EMPLOYEE_FF, link the columns to target.

imga (1)

Click Repository > Save to save the new mapping to the repository. Validate the mapping.
7. Open the workflow w_ods_employee_types, right click on session ―refresh the mapping‖.
8. Edit the session, in Target properties add UNIX or BATCH command to generate the header and footer.
SessioneditMappingTargets (EMPLOYEE_FF) Header Command
SessioneditMappingTargets (EMPLOYEE_FF) Footer Command echo “End of the File”
9. Execute the workflow and verify the data in target file generated using Putty or
Winscp. Also, check the name of file, header and footer as expected.

2 Comments to “How to generate target file with timestamp

  1. Heya i’m for the primary time here. I came across this board and I in finding It truly helpful & it helped me out a lot. I hope to present one thing again and aid others such as you aided me.

    1. hi,thqnk u for ur valuable words..

Leave a Reply

Your email address will not be published. Required fields are marked *