Page 1 of 1

capture the count of number of records

Posted: Fri Aug 31, 2007 9:44 pm
by vij
Hi all,

I would want to know is there any way i can capture the accurate number of records which are inserted/updated to a DB2 table, after running the job?

Initially, I was using an after job sub-routine, which will get the link count, but i am not very sure whether it will be 100% accurate, as sometimes I have seen this scenario - 3 records loaded to DB2 stage, as per the designer but all 3 would be rejected, which can be seen in the director's log.

pls help me out.

Thanks in advance.

Vij

Posted: Fri Aug 31, 2007 10:12 pm
by bkumar103
In the after job subroutine is it possible to query the database to get the statististics on the load into the table.

Posted: Fri Aug 31, 2007 10:39 pm
by JoshGeorge
You can try doing this in multiple ways. Add a reject link in your target and subtract reject row count from main link row count (Pls. Feedback on this if you try this).
Using SQL statement in routine has been discusses many times in the forum, if you use search facility you will get all the required information about that.

Posted: Fri Aug 31, 2007 11:26 pm
by vij
thanks for the replies.

If i use an after job subroutine and query the tables, how to get the actual number of records are updated for that particular run?

Posted: Sat Sep 01, 2007 7:44 am
by chulett
Since you are pondering a SQL solution, how would you do it from a pure SQL standpoint using your tool of choice? Disregarding DataStage, do you have audit columns in your target table that would even allow such a thing to be done?

Posted: Sun Sep 02, 2007 12:21 am
by ray.wurlod
Attend the Introductory class offered by IBM. Precisely this scenario is one of the lab exercises.