want multiple operations executed in if condition

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
ahila
Participant
Posts: 2
Joined: Sun May 18, 2008 7:23 am

want multiple operations executed in if condition

Post by ahila »

hai all,
i want to do multiple operations depending on If condition in a Transformer stage. what are the delimiters used in between the if... then... else constraint i tried to my level, can someone guide me ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The delimiters are spaces or, for formatting, you can use shift-return. IF condition THEN assignment ELSE IF condition THEN assignment ELSE assignment
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. There are no necessary delimiters. The entire If..Then..Else construct can be (and usually is) a single string.

Code: Select all

If test_expression Then expression1 Else expression2

The value generated by test_expression (true or false) determines whether the result of expression1 or the result of expression2 is the overall result of the If..Then..Else expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ahila
Participant
Posts: 2
Joined: Sun May 18, 2008 7:23 am

Post by ahila »

i want to assign 4 different values depending on a category. if i insert the second assignment in the first IF error occurs please help.
OR shall i use simple IF 's than nested IF conditions ?
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are no assignments. For example

Code: Select all

If (condition = 0) Then "A" Else If (condition = 1) Then "B" Else If (condition = 2) Then "C" Else "D"

The parentheses are not necessary; I included them only for clarity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply