Transaction control transformation to get flat file names

Hi Folks,
I have scenario like, I have ten flat files to be loaded in to target but I need to load file names in to a table in mapping level. I think we can do achieve though TC transformation. Unfortunately I did not get though.. Please advise how to implement the logic. ( I need to capture in mapping level only).
This question has been asked one of the interviews.
Thanks for your time!!!

Questions by sureshbabu

Showing Answers 1 - 15 of 15 Answers

Kumar

  • Jun 17th, 2013
 

If you are loading a target table from multiple flat files and looking to add the source file name as a field in each row in the Target Table, then Transaction Control will not help you here. You have to load all the source files using Indirect Option in Session Level and list all the source file names to be loaded in one flat file and give that as an input source file. Then in the PW Designer, go to the Source Definition and enable the property Add Currently Processed Flat File Name Port. This will add an additional port in the source definition. Pass that port to the target tables filename field.

Sanjay Gupta

  • Sep 25th, 2013
 

Please follow following steps:

1. Import one flat file definition and make the mapping as per need.
2. Now make a notepad file that contains the location and name of each 10 flat files.
Sample:
D:EMP1.txt
E:EMP2.txt
E:FILESDWHEMP3.txt and so on
3. Now make a session and in Source file name and Source File Directory location fields, give the name and location of above created file.
4. In Source file type field, select Indirect.
5. Click Apply.
6. Validate Session
7. Make Workflow. Save it to repository and run.


  Was this answer useful?  Yes

Goutham

  • Oct 11th, 2013
 

In source analyser,open ur source flat file and there will be an property called "ADD CURRENTLY PROCESSED FILE NAME" jst enable it and make the SourceType = Indirect in session properties.

Hope this will help

Regards,
Goutham

  Was this answer useful?  Yes

Mayur

  • Jun 23rd, 2014
 

Got to flat file properties and there you will find one icon Add FileName column to this table just click on that option and you can able to add currently processing file. Thank you

  Was this answer useful?  Yes

Hi folks,
If all files have structure then we go for Indirect file method.we set this property at session level by selecting the source def.
After define of the source def at mapping level just double click on the source definition ,go to properties
there is one check option called "Add currently processing filename" if u select this option then automatically along source record automatically transfers the file name.
If u select the option then automatically one port appear at Source qualifier tfn level.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions