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
vasubabu
Participant
Posts: 153
Joined: Wed Jan 25, 2006 2:38 am

switch stage

Post by vasubabu »

Hi,

I am using the switch stage in my job.when i give values in case statemnets as character it is aborting and giving the error as "A value was not specified as a case option"

example:-
selector ENAME
case 'SMITH'
case 'MILLER'.

If i select the selector as EMPNO and numbers in case statment,it is working fine.
Does switch not supports the characters in case statment?

Please reply me why i am getting this error?
VASU..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That error suggests that there's a value in your data for which you have not coded. Try adding an "otherwise" case. Are you directing particular values to particular output channels?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vasubabu
Participant
Posts: 153
Joined: Wed Jan 25, 2006 2:38 am

Post by vasubabu »

ray.wurlod wrote:That error suggests that there's a value in your data for which you have not coded. Try adding an "otherwise" case. Are you directing particular values to particular output channels? ...
Hi Ray,

I am routing output to the proper output link as well.
ex:-
case = 'SMITH' =0
case ='JONES' =1
case = default =2

Still i am getting the same error as A value was not specified as a case option.

Please adivice me to rectify this error.
VASU..
ppgoml
Participant
Posts: 58
Joined: Mon Aug 20, 2007 11:00 pm

Post by ppgoml »

I have no idea on your issue with switch stage, but I think you could use a filter stage or transform stage instead. why not have a try.
Jack Li
greggknight
Premium Member
Premium Member
Posts: 120
Joined: Thu Oct 28, 2004 4:24 pm

Post by greggknight »

my code is
case=N=0
no quote
no problem


options
If not found = output
and I have a file on the reject link.
"Don't let the bull between you and the fence"

Thanks
Gregg J Knight

"Never Never Never Quit"
Winston Churchill
MarkB
Premium Member
Premium Member
Posts: 95
Joined: Fri Oct 27, 2006 9:13 am

Post by MarkB »

You can certainly use 'characters' in the Case statement of the switch.

For example, try:

CASE = SMITH=0
CASE = JONES=1

Under Options, pick either Drop to drop rows not in the CASE, OUTPUT for sendingdown a reject link, or FAIL to abort.
greggknight
Premium Member
Premium Member
Posts: 120
Joined: Thu Oct 28, 2004 4:24 pm

Post by greggknight »

Also I would stay with the switch in stead of the transformer. The transformer is the easy way out but the most costly in terms of performance.

Also you might try the option if not found set it to output and attach a reject file
"Don't let the bull between you and the fence"

Thanks
Gregg J Knight

"Never Never Never Quit"
Winston Churchill
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

greggknight wrote:The transformer is the easy way out but the most costly in terms of performance.
I don't believe that's true any more. But I have no empirical results either way.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
BradMiller
Premium Member
Premium Member
Posts: 87
Joined: Mon Feb 18, 2008 3:58 pm
Location: Sacramento, CA

Post by BradMiller »

The transformer is the easy way out but the most costly in terms of performance.
According to IBM's training materials for Advanced DataStage Training (DX445), page 322: "Transformer constraints are FASTER than the Filter or Switch stages. Filter and Switch expressions are interpreted at runtime, Transformer constraints are compiled."
Post Reply