Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to do Compound Conditionals?

I have a variable which can take on any of 50 values. For two of those values I want to do a certain step. For all the rest I want to do a different step. So, what I want is:

If ($Var = A) OR ($Var = B)
Command set 1.
Else
Command set 2.

Command set 2 cannot be executed UNLESS $Var <> A AND $Var <> B,
so I can't just run Command set 2, and then put Command set 1 into 2 clones with the simple conditions $Var = A, $Var = B.

If I can't do the compound conditionals, I'm thinking I have to put this into 50 steps:

If $Var = A
Command Set 1.
If $Var = B
Command Set 1.
If $Var = C
Command Set 2.
.
.
.

What's the best way to do this?

Thanks,
John Bobinyec

0 votes



2 answers

Permanent link
I have a variable which can take on any of 50 values. For two of those values I want to do a certain step. For all the rest I want to do a different step. So, what I want is:

If ($Var = A) OR ($Var = B)
Command set 1.
Else
Command set 2.

Command set 2 cannot be executed UNLESS $Var <> A AND $Var <> B,
so I can't just run Command set 2, and then put Command set 1 into 2 clones with the simple conditions $Var = A, $Var = B.

If I can't do the compound conditionals, I'm thinking I have to put this into 50 steps:

If $Var = A
Command Set 1.
If $Var = B
Command Set 1.
If $Var = C
Command Set 2.
.
.
.

What's the best way to do this?

Thanks,
John Bobinyec


Hi,

I think you're looking for this enhancement. Feel free to add comments or your scenario. In my projects, I have used your 50 step pattern. In my case, I haven't had that many options so it wasn't as much of an issue.

Brent Ulbricht
RTC Build Lead

0 votes


Permanent link
I've had a similar issue, and been able to reduce it to 3 ifs by using an additional variable telling me if I've met the condition already

if Var$A
.tset env "condition_found='Y'
command set 1

if Var$B
.tset env "condition_found='Y'
command set 1

if $condition_found !='Y'
command set 2

Hope this helps.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Sep 14 '11, 12:30 p.m.

Question was seen: 4,412 times

Last updated: Sep 14 '11, 12:30 p.m.

Confirmation Cancel Confirm