Scenario: Generate different flat file target based on the Location name, like separate files for Mumbai.dat, Bangalore.dat, and Delhi.dat
Source Table:
Dept name
|
Dept ID
|
Location
|
DWH
|
1
|
Mumbai
|
Java
|
2
|
Bangalore
|
Dot net
|
3
|
Delhi
|
- Sort the source table by the column Location using a Sorter.
- Create Expression transformation and create the below ports
In_Location =
location
V_flag = IIF(In_Location = V_ Location, 0,1)
V_ Location = In_Location
Output_flag (output port) = V_flag
V_flag = IIF(In_Location = V_ Location, 0,1)
V_ Location = In_Location
Output_flag (output port) = V_flag
Output_file_name
(output port) = location ||'.dat'
****This expression will check when Location changes (Eg.from Mumbai to Bangalore).
3. Now we need to connect the
Expression Transformation to TransactionControl transformation.
Informatica Power Centre allows us to control the roll back and commit on transaction
based on set of rows that passes through the TransactionControl transformation.
This allows to define your transaction whether it should be committed or
rollback based on the rows that pass through, such as based on the Entry Date
or some other column.
Use the following syntax
for the expression:
IIF
(condition, value1, value2)
IIF(Output_flag
= 1, TC_COMMIT_BEFORE, TC_CONTINUE_TRANSACTION)
****This expression will write
to the output file when location changes (Eg.from Mumbai to Bangalore)
4. Connect to the Target Table
Note: We have to use
special port called “Filename" port in the Target file definition.
Experts, please share your
valuable thoughts…..
Good one...Thanks..
ReplyDeleteThanks .Please keep sharing your thoughts on Informatica
Deletefirst of all nice explanation
ReplyDeletehow to send dynamic emails? after completion of successful file generation?
I know it can be done by writing a script and calling it.. if anyone can share the script or the ways to do it, will be of great help.
thanks
REALLY GREAT EXPLANATION....KEEP POST MORE SCENARIOES.
ReplyDeleteThanks a lot for posting the useful information..
ReplyDeleteReally nice post...
ReplyDeleteExcellent explanation
ReplyDeletekindly share the snapshots
ReplyDeleteThanks for your explanation. How to generate dynamic targets based on source groups if the Target has to be a SAS dataset? Or if i have to generate target tables in Oracle dynamically? Thanks.
ReplyDeleteHow can we create dynamic target files in Informatica Developer 9.6
ReplyDeleteSend dynamic mails:
ReplyDeleteFile_name=`basename $file_name`
uuencode (file_path/file_name $File_name)|mailx -s ""
Any idea how to generate dynamic files with HDFS Flat File Targets? When I give /path/to/hdfs/$$FileName, I get $$FileName created in HDFS path.
ReplyDeleteThanks!
Hi, I have followed same steps as mentioned above. But my WF is failing with below erro
ReplyDeleteERROR: The Writer ran out of buffer pool data blocks, terminating the session
Any idea why it is failing and how to fix it?
i need to load the dept data in to target,for each dept have separate target
ReplyDeletetarget name is dept name coming from source (sales,hr,marketing etc.) and i don't know the what are the dept name have in source
pls solve