05.

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.

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
(RTR_ODS_EMPLOYEE_TYPES).
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.

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
echo “EMPLOYEE_ID|EMPLOYEE_NAME|DATE_HIRED|TYPE_CODE”
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.