How to capture number of rows processed

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
midmaxds
Premium Member
Premium Member
Posts: 71
Joined: Mon Oct 26, 2015 11:44 am

How to capture number of rows processed

Post by midmaxds »

Is there a way we can capture the rows written into target (file/DB) &
write that information to an audit table.

For example if we have a job like this

Sequential File --> Transformer --> DB2

Say 1000 records are written to oracle DB. I want to insert the value 1000 into an audit table (which is in DB2 but another schema).
We are not planning to use parallel/Server routines. Any other alternatives please?
We are running on 2 nodes and DataStage is in UNIX.
Midhun
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So you want to capture the number of rows processed without any evil routines? Add an aggregator from the transformer, count the records and write that to your second target.
-craig

"You can never have too many knives" -- Logan Nine Fingers
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Craig's methodology is good as long as you just need approximate counts. However, any rejected records would throw the count off.

If you have to get an exact count that excludes rejected records, you might want to check out the DataStage Operational Database, to see if it is stored there. If not, then you'd have to do the routine calls you are trying to avoid!
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Rejected records? We don't need no stinking rejected records! :P
-craig

"You can never have too many knives" -- Logan Nine Fingers
midmaxds
Premium Member
Premium Member
Posts: 71
Joined: Mon Oct 26, 2015 11:44 am

Post by midmaxds »

Hi Craig and Andy,
Yes, the number of rejected records are not needed at this point.
So, we will go with the aggregation. Thanks much.
Midhun
Post Reply