Page 1 of 1

How to get the records count by the datastage operator?

Posted: Wed May 27, 2015 9:23 am
by Johnny0638
Hi guys,

I have a requirement of filter the records by some conditions and check the recods count.

For example , I want to get the records which the conditions are column1 = 0 and column2 <>1, and the records count should more than 100.
I can use the filter operator to get the records with the conditions, but how to check whether the records count is more than 100?

if all the conditions are equal(=), i think i can use the group operator to get the countField, and check it . But if the conditions are not equal(eg:>, <, >=, <=, <>...), how to get the records count by the operator?

Which operator can get the records count from the dataset?

Any help please!
Thanks!

Johnny

Posted: Wed May 27, 2015 9:27 am
by chulett
Not really clear why you are mentioning "by the osh". Is this something you want to do inside a job (while it is running) or outside of a job after it completes?

Posted: Wed May 27, 2015 9:36 am
by Johnny0638
I want to realize this requirement by the osh script with operators , like this: import -> hash -> tsort -> filter -> group -> export

Posted: Wed May 27, 2015 9:51 am
by chulett
Sorry but I have to ask - why? One would typically do that by building the appropriate parallel DataStage job and letting the product generate that for you. Why do you feel the need to be down at that level building OSH scripts by hand? IMHO - leave that to the experts or people who come from the original product and have that skill set.

Posted: Wed May 27, 2015 10:05 am
by Johnny0638
Thanks for your reply.
But I have to write the original osh scripts in our develop environment.

Posted: Wed May 27, 2015 10:09 am
by qt_ky
That sounds odd. So, you're not using DataStage Designer at all?

Posted: Wed May 27, 2015 4:16 pm
by ray.wurlod
Johnny0638 wrote:Thanks for your reply.
But I have to write the original osh scripts in our develop environment.
Resist stupid requirements.

This task is far more easily done without osh. After all, it's not really a parallel operation. What you're really seeking to determine are link row counts. There are calls within the DataStage API for retrieving this information, or it can be garnered from the DataStage Operations Database if you are on version 8.7 or later.