Page 1 of 1

Priority of logical opeand in INCLUDE COND.

PostPosted: Tue Oct 09, 2012 12:02 am
by Mehdi shri
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).

Re: Priority of logical opeand in INCLUDE COND.

PostPosted: Tue Oct 09, 2012 12:08 am
by Akatsukami
What does it say in the fine manual?

Re: Priority of logical opeand in INCLUDE COND.

PostPosted: Tue Oct 09, 2012 5:34 pm
by BillyBoyo
Follow the learned advice already give for your general question.

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.

Re: Priority of logical opeand in INCLUDE COND.

PostPosted: Tue Oct 09, 2012 8:29 pm
by dick scherrer
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

Re: Priority of logical opeand in INCLUDE COND.

PostPosted: Tue Oct 09, 2012 8:49 pm
by Akatsukami
Is IBM planning to introduce the DWIM opcode in the Series Ω architecture? :geek:

Re: Priority of logical opeand in INCLUDE COND.

PostPosted: Tue Oct 09, 2012 9:10 pm
by dick scherrer
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 8-)

Re: Priority of logical opeand in INCLUDE COND.

PostPosted: Wed Oct 10, 2012 5:27 pm
by BillyBoyo
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.