How to get the records count by the datastage operator?

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
Johnny0638
Participant
Posts: 5
Joined: Tue May 26, 2015 8:27 am

How to get the records count by the datastage operator?

Post 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
Last edited by Johnny0638 on Wed May 27, 2015 9:42 am, edited 1 time in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Johnny0638
Participant
Posts: 5
Joined: Tue May 26, 2015 8:27 am

Post by Johnny0638 »

I want to realize this requirement by the osh script with operators , like this: import -> hash -> tsort -> filter -> group -> export
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Johnny0638
Participant
Posts: 5
Joined: Tue May 26, 2015 8:27 am

Post by Johnny0638 »

Thanks for your reply.
But I have to write the original osh scripts in our develop environment.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

That sounds odd. So, you're not using DataStage Designer at all?
Choose a job you love, and you will never have to work a day in your life. - Confucius
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply