how to access DB2 Counts in a job

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
Sreedhar
Participant
Posts: 187
Joined: Mon Oct 30, 2006 12:16 am

how to access DB2 Counts in a job

Post by Sreedhar »

Hello,

I have a job where I am loading data from a flat file to a database.

Flat file -> Transformer -> Db2 API Stage

I know that there are 100 records in the flat file. Now I want to know how many of them are inserted into the DB2 Tables?

I can get that by saying select (*) from db2.table, but how can I do a comparision between the flat file content to that of Db2 count? Is there a way in which I can accesss Db2 counts with in the same job?

Regards,
Regards,
Shree
785-816-0728
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No.

DataStage will tell you how many rows it sent to DB2, and can capture any that were rejected (which you could also count and perform arithmetic).

But the only way you can reliably determine what's in a table is to query the table.

If your records include a run identifier or last updated timestamp, you can constrain your query on that column.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
raghu22
Premium Member
Premium Member
Posts: 15
Joined: Sun Oct 11, 2009 11:33 am

Re: how to access DB2 Counts in a job

Post by raghu22 »

You can use the @inrownum function in the transformer and output the result to a flat file or a table
Post Reply