What is the way to add the total number of records that have been read from SRC in the TGT file as last line?

What is the way to add the total number of records that have been read from SRC in the TGT file as last line?
Let me clear you if my TGT is a flat file and want to add total number of records that are written in TGT as a last line with sysdate.

Questions by N SRIRAM K   answers by N SRIRAM K

Showing Answers 1 - 21 of 21 Answers

chegoane

  • Feb 27th, 2008
 

The info is in the informatica repository tables. You'll have to generate a lookup to look in that table providing the session name and time started.

  Was this answer useful?  Yes

Hi,

This can be achieved using an Aggregator transformation.

In the aggregator transformation, check the group by columns for all the source columns and add one extra output port in the aggregator.

OUT_TTL_RECORDS=count(*)

Pass this port value as the last record of the flat file target.

Thanks.

  Was this answer useful?  Yes

janakiram

  • Oct 16th, 2013
 

Hi,

Source--->Sq--->Tgt(File)

in post session success command use the below script.

Directory=/root/Informatica/9.0.1/server/infa_shared/TgtFiles/Johnny
cd $Directory


Input=$1
File_Name=$(ls -ltr ${Input}_*.out|awk -F {print $9})

Count=$(wc -l < $File_Name)

File Count=$(expr $Count - 1) ----->for removing the Header line
echo T$File_Count>>

  Was this answer useful?  Yes

Vijay

  • Jan 3rd, 2014
 

first will generate file with data. next create another flow in a file which will contain only count and make sure the file being generated is of same name and will mention a condition in the session to merge if file exists.

Ankit Kansal

  • Feb 15th, 2014
 

Easy way of achieving the functionality is with Unix commands however if you want to achieve it using Informatica only then Then just before dumping your data to your target use aggregator count() function later in expression use sysdate function and then put that count in a temp file later in post session success command merge your both target and temp file...

  Was this answer useful?  Yes

Surbhit

  • Apr 1st, 2014
 

Use an aggregator and do no group by any key

  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