What does 'output row only once' will do in filter

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

Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

What does 'output row only once' will do in filter

Post by Prince_Hyd »

Hi folks

In filter we have an option like "output row only once" what's the functionality of this option can anyone explain with example



Thanks
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: What does 'output row only once' will do in filter

Post by SURA »

It is clearly mentioned in the stage Information text.

Code: Select all

Type: List
Set to true to output the row only to the first 'Where Clause' it matches; False means the row will be output to all 'Where Clauses' that match.
To get the full understanding create a dummy data and test it. So that you can feel the difference.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

It will not pass the record to second where condition...

Post by jpraveen »

Suppose if u had two where conditions,

1st where condition:- Dept no =10

The condition met records will pass into Target1

2nd Where Condition :- Dept no in (10,20,30,40)

If you use 'output row only once' , Then the record will not pass the second where condition and it will not go to Target2.

if you are not using 'output row only once' , then the record will pass into 2 Targets.
Jaypee
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Is this a bit like the 'Otherwise' functionality in the PX Transformer?
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The "otherwise" will output every row that doesn't match any of the conditions in the previous constraints for links, which is a bit different from what the "output row only once" does.
Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

Re: It will not pass the record to second where condition...

Post by Prince_Hyd »

Tats superb explanation.I got it.But as you mentioned in second condition that we have to write deptno in(10,20,30) when i'm writing this condition in filter compilation is going fine but while i run the job i'm getting error how come??

i wrote like

First condition deptno = 10

Second condition deptno in(10,20,30)

how come running is getting failured.


Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps you should mention the actual error or issue. Ah...

Please do not put needed information in the subject when replying as others will not be able to see it unless they start a reply, like I just did.

"Re: It will not pass the record to second where condition..."

Is this your "failure" or is there more to it than that?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I don't recall that IN is supported in the Filter stage.

Rather you need multiple WHERE conditions each directing to the same output link number. Output links are numbered from 0.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

Post by Prince_Hyd »

Hey Ray

I tried your solution but it din't worked.Any other way?




Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It DOES work.

Show me exactly what you did, and explain what you mean by "din't worked".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

Post by Prince_Hyd »

i have input table like this

cust_id,cus_name,deptno
1,uma,10
2,varun,20
3,siva,30
1,rathode,40

and in filter i mentioned first where condition as

1) where =deptno=10 to output link 0

and second where clause as

2)Where =deptno=10 to output link 1

and third where clause as

3)Where = deptno=20 to output link 1

while compiling the job is successfully completed but while running i'm getting failure
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

WHAT failure?

Right now your diagnosis is in the same league as "my car won't start" and you expect us to guess at the cause.

Post full details of any error messages you have received.

What's the data type of deptno?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

Post by Prince_Hyd »

Hi ray

Failure means when you compile you get blue line when you run if success green will come else red for failure so like that i got red line.

Any how i find another solution like in filter we can keep like deptno <=40 where it will cover all the dept's.



Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A red line indicates that the job has aborted. You then look in the job log to find out what caused the job to abort. I have already asked you to post that information, and am still waiting.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Prince_Hyd
Participant
Posts: 35
Joined: Mon May 06, 2013 5:59 am

Post by Prince_Hyd »

Hi ray

I got error like this in log file

Filter_1:Error occured during initialize from Args()
Filter_1:Parse error;Expected comparision operator('>','<')after literal,got:<eof>.(....)
main_program:Creation of a step finished with status = Failed

see if i give condition like below it works fine

where deptno=10
output link =0

deptno=10
outputink=1

deptno=20
oututlink=1

supose if i give like this
where deptno=10
output link =0

deptno=10
outputink=1

deptno=20
oututlink=1

deptno=30
outputlink=1


then i get error

but as is said i got the solution after i checked the log file

Thanks for your response.
Post Reply