Page 1 of 1

Logic to reject

Posted: Fri Mar 16, 2007 8:39 am
by kashif007
I am trying to implement a logic but I am not sure How do I apply it.

I am reading say 5 columns, if a condition(On Constraint transformer) does not match then I want to reject all rows associated to that one column. But other Rows should show up.

Ok let me try ot explain again. Suppose I have five columns as follows:
sno,name,property,value,area. If I have 5 rows associated to one "property" and one of the row has not satisfied condition say "Value" not numeric then I want to reject all five rows to reject link. Although 4 have satisfied the condition. I am using transformer stage to do so.

Can anyone suggest what do i do to get this business rule working.

Posted: Fri Mar 16, 2007 9:30 am
by Andet
You might have to resort to writing the file out to a temporary space and then reading it back in, keeping the grouping information that you desire.
We've done some of this using external routines, so DataStage doesn't even see the writing and reading.
The problem, as I see it, doing this in DataStage alone, is that some of the records that you want to reject have already been passed; so you have to save all of the sorted input records into groups, where the decision on whether or not to reject is not done until the last record in the group is read.
The only way to do this is to save all the records in the group-for a single pass methodology.
If you have two reads into the same feed, then you can pass along the second feed once the first feed has made the keep or reject decision.

Hope this helps some....