Switch/Case

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
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Switch/Case

Post by agpt »

How do we implement Switch/Case statement in transformer?
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

nested if-then-else
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Post by agpt »

Thanks priya...
but it means thr is no direct implementation of switch/case available in transformer?
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

I don't think you have direct implimentation for that, but you can use stage variables to keep the derivation simple if using If-then-else.

You can also send data to different links based on constraint in case with calculation/values defined in 'Then' and then funnel then afterwards.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Post by agpt »

Thanks
truenorth
Participant
Posts: 139
Joined: Mon Jan 18, 2010 4:59 pm
Location: San Antonio

Post by truenorth »

AFAIK, switch/case has no equivalent in DS, other than the way priya suggested.
Todd Ramirez
Sr Consultant, Data Quality
San Antonio TX
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is no direct implementation. If you feel you really must have this, embed it in a routine and invoke that from the Transformer stage.

Seems like overkill to me. Most situations can be accomplished using sets of stage variables, as suggested.
Last edited by ray.wurlod on Wed May 26, 2010 6:39 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
truenorth
Participant
Posts: 139
Joined: Mon Jan 18, 2010 4:59 pm
Location: San Antonio

Post by truenorth »

AFAIK, switch/case has no equivalent in DS, other than the way priya suggested.
Todd Ramirez
Sr Consultant, Data Quality
San Antonio TX
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not sure what you're attempting to accomplish, but there IS a Switch stage that you may wish to investigate.
Last edited by ray.wurlod on Wed May 26, 2010 3:59 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Post by agpt »

Thanks to all of you.

Ray,

Though I couldn't read your previous messae completely as some content was hidden but thanks for the great help you have been giving me on my posts.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I doubt that you missed much of it, but I've removed the Premium status anyway.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Don't think he meant that one. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply