Switch Activity - specifying ranges

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
DHallam
Participant
Posts: 20
Joined: Fri Nov 07, 2008 9:32 am

Switch Activity - specifying ranges

Post by DHallam »

Hi,

I'm looking at using the Switch activity. I have specified the column to select on but, in the cases section, the documentation just talks about having exact matches. The kind of thing that I want to do is say if the value > 100 then put onto output link 1, > 200 put onto output link2, otherwise reject.

Likewise, I'd like to do a string insensitive search as well (like an oracle LIKE %AAA%), i.e. if string contains AAA then put onto link 1, BBB onto link 2 and others onto reject.

At the moment it looks like I'd have to define a case for every case, e.g.

1=0
2
3
4
5
...
99
100=1
101
102
103
... etc

which would get quite painful over many numbers.

Does anyone know if this can be done?

Many thanks,

Dave
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

Hi,

Use transformer and create three output link based on the filtering criterion.

Thanks
Girija S
DHallam
Participant
Posts: 20
Joined: Fri Nov 07, 2008 9:32 am

Post by DHallam »

I thought the transformer just manipulated data and pushed the new data onto the output link. I didn't know there was selection. What I want is the inverse of the funnel, i.e. a selective demultiplexer. No transformation of data. The same data will go one whichever link is selected.

How would the transformer do this?

Many thanks.
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Switch Activity - specifying ranges

Post by kandyshandy »

Try using FILTER stage where you can specify < or > etc. You can specify the same as CONSTRAINTS in transformer stage.
Post Reply