Boolean results

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
New2DS
Participant
Posts: 33
Joined: Sat Jun 26, 2004 9:58 am

Boolean results

Post by New2DS »

Hi All,

I need help in understanding the boolean expression. The expressions below are in a routine

Code: Select all

If previous.col = current.col
then ResultCol = @TRUE
else ResultCol = @FALSE
When I have the condition like

Code: Select all

Ex: If Not(ResultCol) then 'xxxx' else 'yyy' 
When we use the Not() with boolean does it mean 'Even the expression is true or false the result should be xxxx'?

Code: Select all

Ex: If (ResultCol) then 'zzz' else 'Yes'
Does the above expression mean 'if the result is true then 'zzz' else 'Yes'? Hope I get some help in understanding the expressions.

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

Re: Boolean results

Post by chulett »

New2DS wrote:When I have the condition like

Code: Select all

Ex: If Not(ResultCol) then 'xxxx' else 'yyy' 
When we use the Not() with boolean does it mean 'Even the expression is true or false the result should be xxxx'?
No, it reverses the evaluation of the condition. So, rather than a TRUE result taking the if clause, the FALSE result does. So it means 'If the expression is not True then 'xxxx' else 'yyy'.

Code: Select all

Ex: If (ResultCol) then 'zzz' else 'Yes'
Does the above expression mean 'if the result is true then 'zzz' else 'Yes'?
Yup. :wink:
-craig

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