## Priority of logical opeand in INCLUDE COND.

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

### Priority of logical opeand in INCLUDE COND.

Dear friends.
Which logical operand (AND,OR) has the must priority in the control statement of SORT utility which contain more than 2 logical operand in INCLUDE COND parameter like following:
INCLUDE COND=(1,5,CH,EQ,C'COND1',OR,10,5,CH,EQ,C'COND2',AND,
15,5,CH,EQ,C'COND3',AND,20,5,CH,EQ,C'COND4',
OR,25,5,CH,EQ,C'COND5',OR,30,5,CH,EQ,C'COND6')

Is there a way to qualifying control statement in order to extract data based on my considered condition? (for example using of parenthesis to specify priority).
Last edited by Mehdi shri on Tue Oct 09, 2012 12:10 am, edited 1 time in total.
Mehdi shri

Posts: 138
Joined: Sun Jan 16, 2011 6:30 pm
Has thanked: 57 times
Been thanked: 0 time

### Re: Priority of logical opeand in INCLUDE COND.

What does it say in the fine manual?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day

Akatsukami
Global moderator

Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

### Re: Priority of logical opeand in INCLUDE COND.

Yes, use parenthesis. As soon as it gets remotely "complicated" that's what I do. The computer understands it however you write it. I write it to be understood by humans, and it has vastly reduced the number of mistakes I've made over the years and vastly reduced the amount of time spent by people trying to understand the code.

If you can't simplify the actual condition, use parenthesis to explain to humans what you mean, then the computer will do what you want, not only what you have told it.
BillyBoyo
Global moderator

Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

### Re: Priority of logical opeand in INCLUDE COND.

Hello,

then the computer will do what you want, not only what you have told it.
No matter how badly some particular outcome might be desired, the computer Will Do what you tell it

d

dick scherrer
Global moderator

Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

### Re: Priority of logical opeand in INCLUDE COND.

Is IBM planning to introduce the DWIM opcode in the Series Ω architecture?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day

Akatsukami
Global moderator

Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

### Re: Priority of logical opeand in INCLUDE COND.

Hi Akatsukami,

planning to introduce the DWIM opcode
Don't recall if it was this forum or some other but a while back i posted a stunt i did in the mid-90's (when people were converting from ascii terminals to Windows). Most of the power users wanted nothing to do with this "mouse-click" thingy. Most common was getting the mouse and the keys all out of kilter. Almost all of the user's work interacted with some database or other (other than e-mail, word processing, and spreadsheets) so when they got tangled up they called my database sjupport team. Multiplle users per day/hour.

One weekend while browsing thru one of the big tech-warehouse sales i found some boxes of keyboard chicklets (bone and black) that were blank. When i found i could buy them for \$.05 each, i bought 50 of each. Went back to the office Monday and with some Clear label tape typed DWIM so it would look just like a "real" key on a few of each (black type for the white keys, white type for the black). Then i put the 2-sided tape on the underside and carried them in my pocket.

When i'd get to one of the users who was one of the "good ones" and saw their plight, i quietly showed them how to fix their problem and fastened one of these on the top-right of the keyboard. Some saw it right away and others called back later and asked about this DWIM key
Hope this helps,
d.sch.

These users thanked the author dick scherrer for the post:
Mehdi shri (Wed Oct 10, 2012 10:32 pm)

dick scherrer
Global moderator

Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

### Re: Priority of logical opeand in INCLUDE COND.

I'd arrange your statement something like this. I can't get it as you want with the combinations of OR and AND because I don't know, so this is an example.

INCLUDE COND=((01,5,CH,EQ,C'COND1'),
OR,((10,5,CH,EQ,C'COND2'),
AND,((15,5,CH,EQ,C'COND3'),
AND,(20,5,CH,EQ,C'COND4'))),
OR,(25,5,CH,EQ,C'COND5'),
OR,(30,5,CH,EQ,C'COND6'))

Personally I'd use sybols/SYMNAMES as well, so that the field is described and the meaning of the constants is described.

These users thanked the author BillyBoyo for the post:
Mehdi shri (Wed Oct 10, 2012 10:32 pm)
BillyBoyo
Global moderator

Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times