Tracking count of records in a flat file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Akumar1
Participant
Posts: 48
Joined: Tue May 22, 2007 3:38 am
Location: bangalore
Contact:

Tracking count of records in a flat file

Post by Akumar1 »

We have a requirement like this:

The first job extracts records from a data source and stores it in a flat file. The second job extracts these records from the file and performs transformations and then writes the transformed records to another flat file. Third job extracts the records from the last generated flat file and writes them to the target table. At the end of the sequencer run, there should be a flat file which holds the records extracted in the first job,records transformed in the second job and records inserted in the third job. What are all the various ways DataStage provides to implement this.

Can the LinkCount property be used to fetch and write the count of records to another sequential file after each job run, which will be called the audit file?

Any responses would greatly be appreciated.
Regards,
Akumar1
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes it could, but you could simply create a second output from the Transformer stage that runs through an Aggregator stage (with no grouping columns) to produce the count.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

You could also use an after job ExecSH command to do a quick line count.
Something along the lines of :
wc -l #filename# >> countfilename

Just a thought.
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
sambit
Participant
Posts: 52
Joined: Mon Sep 05, 2005 4:59 am

Post by sambit »

Well... I would suggest to have a new col in each job which is popualted as @outrownum. You can later combine the @outrownum from each file and put it in a single file which will say how many rows were transformed in each of the job.
Thanks !!!
Sambit
Post Reply