Switch Stage

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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Switch Stage

Post by somu_june »

Hi,

Iam using switch stage. I have a column Year and it has value starting from 1990 to 1999, in switch case properties I mentioned

Case = 1990 =0
Case = 1991
Case =1992=1
Case=1993=1
Case=1994
Case=1995=2
Case=1996=2
Case=1997=2

and in options

I mentioned

Discard Value =2

MY aim is to discard year records 1995,1996 and 1997 to the dataset but my job is failing by throwing the following error


Switch_3,0: Output dataset number 2 has no case values assigned to it.


I have Link label values as 0,1,2 and primary reject and datatype of Year input column is integer.


Thanks,
Somaraju.
somaraju
ysrini9
Participant
Posts: 108
Joined: Tue Jul 12, 2005 2:51 am

Re: Switch Stage

Post by ysrini9 »

somu_june wrote:Hi,

Iam using switch stage. I have a column Year and it has value starting from 1990 to 1999, in switch case properties I mentioned

Case = 1990 =0
Case = 1991
Case =1992=1
Case=1993=1
Case=1994
Case=1995=2
Case=1996=2
Case=1997=2

and in options

I mentioned

Discard Value =2

MY aim is to discard year records 1995,1996 and 1997 to the dataset but my job is failing by throwing the following error


Switch_3,0: Output dataset number 2 has no case values assigned to it.


I have Link label values as 0,1,2 and primary reject and datatype of Year input column is integer.


Thanks,
Somaraju.

Hi,
In switch stage, we need to give like
Case=1990=0
Case=1991=1
Case=1992=2
Case=1993=3
Case=1994=4
Case=1995=5
Case=1996=6
Case=1997=7
Case=1998=8
Case=1999=9

Input data is diveded into 10 output links.
If you need to load 1995,1996,1998 output links data into single Dataset,you can use Funnel stage collects data from these 3 input links then load data into dataset.

Thanks
srini
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

No need to funnel, you can specify the same link for multiple switch definitions i.e. in last example

Case=1990=0
Case=1991=1
Case=1992=2
Case=1993=3
Case=1994=4
Case=1995=5
Case=1996=5
Case=1997=7
Case=1998=5
Case=1999=9

'95, '96 and '98 are all going to link 5.
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi,

Thanks for the reply I want to use the Discard Value option in Switch stage. I know if you mention the link it will go to that link.



Thanks,
somaraju.
somaraju
Post Reply