iif

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
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

iif

Post by fmou »

Hi,

Does DS has the iif or the ? : operator in C?

E.g., I want to build up an output string

part1 : part2 : part3

where part1 & part3 are substring of the input string, and part2 need to be conditionally build according to some specific key char in the input string. The "part2" expressed in C would be

Code: Select all

( condition ? exp1 : exp2 )
how can I do that in DS?

thanks
stuartjvnorton
Participant
Posts: 527
Joined: Thu Apr 19, 2007 1:25 am
Location: Melbourne

Post by stuartjvnorton »

if condition then
part1 : exp1 : part3
else
part1 : exp2 : part3
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Code: Select all

part1 : (if condition then exp1 else exp2) : part3 
-craig

"You can never have too many knives" -- Logan Nine Fingers
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

Post by fmou »

chulett wrote:

Code: Select all

part1 : (if condition then exp1 else exp2) : part3 
...
That's the exact answer that I was expecting for.

Thanks a lot chulett
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No problem. DataStage doesn't have an "Immediate If" function like Informatica so just stick with classic if-then-else syntax.
-craig

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