How to use Case Structures in place of nested if

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
Team_2007
Premium Member
Premium Member
Posts: 11
Joined: Mon Jun 11, 2007 6:10 am

How to use Case Structures in place of nested if

Post by Team_2007 »

Hi All,
I have a requirement as mentioned below.

If Dept_no=100 Or Dept_no=101 Or Dept_no=102 Or Dept_no=103 Then 1203.24 Else If Dept_no=104 Then 12345.89 Else 0

Can any one of you please tell me how to use Case Structures in place of Nested If Conditions.

Thanks in Advance.
Last edited by Team_2007 on Mon Jul 30, 2007 5:39 am, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not possible in a derivation or constraint expression, which yours appears to be.

It is possible in a routine, but yours does not have the form of a set of nested IF statements (containing assignment statements) that one would expect to find in a routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, you'd need to write a custom routine if you really felt the need to convert this into a 'case' statement. You would then reference the routine in your derivation.
-craig

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