In the construct "if then else" used in the transfomer it is mandatory to give some values for else clause.
E.g If Color='Green' then 1 Else 0
Is it possible to make "Else" portion of "If then Else" a no-op code? i.e I do not want Else portion of code to be executed at all.
if then else
Moderators: chulett, rschirm, roy
In the BASIC language you can do this, but when using the construct in DataStage jobs the result of the IF-THEN-ELSE is assigned to a variable, i.e. it is the right side of an "=" statement. Because of this an IF clause must assign a value to both outcomes of the condition.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The If..Then..Else construct here is a conditional expression (not a statement) and therefore must return a value irrespective of the result of the test expression. The concept of "no operation" is irrelevant.
You will notice in the Then and Else parts there are value-generating expressions, not executable statements.
In routines you can use conditional expressions as rvalues (on the right hand side of an assignment statement for example) and the same rules apply there.
You will notice in the Then and Else parts there are value-generating expressions, not executable statements.
In routines you can use conditional expressions as rvalues (on the right hand side of an assignment statement for example) and the same rules apply there.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.