Issue with multiple IF's in a transformer derivation
Moderators: chulett, rschirm, roy
Issue with multiple IF's in a transformer derivation
I am having issues with using multiple IF.THEN.ELSE conditions. Psl see below. I have 6 conditions to be tested in a single statement. I used a routing using a Begin..Case..END. Thsi worked good for few times. But all of a sudden the routine started giving errors in PROD server. When ever this happened, I had to promote the routine again. To prevent this in the future, I want to put it in a transformer derivation. When I put like this it gives me an error. Any help pls.
If (C_LINE=1) Then
'b'
if (C_LINE=2) then
'd'
end else
'f'
end
end
Thanks
Kumar
If (C_LINE=1) Then
'b'
if (C_LINE=2) then
'd'
end else
'f'
end
end
Thanks
Kumar
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Premium Member
- Posts: 22
- Joined: Tue Oct 31, 2006 5:16 pm
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Re: Issue with multiple IF's in a transformer derivation
Routines are always (most of the time) a better way to code than using multiple If..Then...Else statements. Can you post the routine you created and the objective?vskr72 wrote:I used a routing using a Begin..Case..END. Thsi worked good for few times.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Re: Issue with multiple IF's in a transformer derivation
What errors did you get? You could try and debug that.vskr72 wrote:But all of a sudden the routine started giving errors in PROD server. When ever this happened, I had to promote the routine again.
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Your syntax is OK in a server routine, but not in an expression in a Transformer stage, which must be a single string.
There is never an End in a conditional expression.
There is no elseif statement in a conditional expression.
Your solution for an expression in a Transformer stage must be
Note that "Else If" is two words. If you find it clearer, surround the nested conditional expression in unnecessary parentheses.
There is never an End in a conditional expression.
There is no elseif statement in a conditional expression.
Your solution for an expression in a Transformer stage must be
Code: Select all
If (C_LINE=1) Then 'b' Else If (C_LINE=2) Then 'd' Else 'f'
Code: Select all
If (C_LINE=1) Then 'b' Else (If (C_LINE=2) Then 'd' Else 'f')
Last edited by ray.wurlod on Fri Feb 02, 2007 2:49 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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thanks a lot
Ray,
Thanks a lot. It worked.
Kumar
Thanks a lot. It worked.
Kumar
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: