Diff between Filter and Switch Stages

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
swetha007
Participant
Posts: 2
Joined: Mon Apr 10, 2006 5:36 am

Diff between Filter and Switch Stages

Post by swetha007 »

Hai

In which seneario will be used Filter and switch stages.which one is better for performance issue considerations.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. :D

This sounds suspiciously like an interview question. A short answer is that one uses a value to make its decision, the other can use a expression that is somewhat like an SQL WHERE clause.

Performance is not the issue; it's functionality. You choose the right stage for the job.

Read the appropriate chapters in the Parallel Job Developer's Guide or invoke on-line help to learn more.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
koolnitz
Participant
Posts: 138
Joined: Wed Sep 07, 2005 5:39 am

Post by koolnitz »

As mentioned by Ray, Filter is like WHERE clause in your SQL while Switch is analogous to Switch in 'C' language, where you set cases.
Switch supports atmost 128 output links while Filter supports any no. of output links (atleast in theory). Both the stages can have an optional Reject link.
Nitin Jain | India

If everything seems to be going well, you have obviously overlooked something.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

The only thing to keep in mind with the Switch stage is that the parameter used for decision making must be integer (or char, which in C is 'equivalent'). That means no string, no decimals, no dates, etc.

The switch is useful, don't get me wrong. But it does have limitations that Filter does not have.

Brad.
vijayrc
Participant
Posts: 197
Joined: Sun Apr 02, 2006 10:31 am
Location: NJ

Re: Diff between Filter and Switch Stages

Post by vijayrc »

swetha007 wrote:Hai

In which seneario will be used Filter and switch stages.which one is better for performance issue considerations.
Well SWITCH is like your CASE statement in C or an EVALUATE statement in COBOL wherein when the condition is met, exit is taken.

FILTER is used to drive an input to many different streams/path.
rony_daniel
Participant
Posts: 36
Joined: Thu Sep 01, 2005 5:44 am
Location: Canada

Re: Diff between Filter and Switch Stages

Post by rony_daniel »

vijayrc wrote:
swetha007 wrote:Hai

In which seneario will be used Filter and switch stages.which one is better for performance issue considerations.
Well SWITCH is like your CASE statement in C or an EVALUATE statement in COBOL wherein when the condition is met, exit is taken.

FILTER is used to drive an input to many different streams/path.
Well Vijay i guess what you said for FILTER is applicable to SWITCH as well. But SWITCH does not necessarily exit out like a CASE statement. If you set to discard or drop the records which does not meet the conditions then you are getting different output streams for SWITCH also.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:twisted: I wonder what the "correct" answer (the one sought by the interviewer) is?
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