If value is negative need to make it default 0(zero)

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
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

If value is negative need to make it default 0(zero)

Post by synsog »

Hi All,

Can we find whether the field is having Negative(-) value then I need to write default value zero(0).

Please advise any easy way for this.

Thanks in Advance
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Given the documented if-then-else construct in a transformer, how would you test for a negative value (that is, what would be the condition that determines whether or not the value is negative)?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
peddakkagari
Participant
Posts: 26
Joined: Thu Aug 12, 2010 12:07 am

Post by peddakkagari »

IF Column_Value < 0 THEN 0 ELSE Column_Value
selina_king
Participant
Posts: 21
Joined: Fri Jul 29, 2011 8:02 am

Post by selina_king »

both of peddakkagari and jwiles are right. but I have another idea to resolve the problem.

you can user transformer stage and use "null handing" function, you can set any value when is null
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

selina_king wrote:both of peddakkagari and jwiles are right. but I have another idea to resolve the problem.

you can user transformer stage and use "null handing" function, you can set any value when is null
Note, however, that nowhere in their problem statement is the word "null" mentioned.
-craig

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