On Fri, 2 Mar 2007 08:14:52 -0600, Carol Srna <[EMAIL PROTECTED]> wrote:

>Hello All.
>Input Fields:
>Volser: 3-8
>
>STATUS $ 71
>
>DSN: $ 10-53
>
>Location: $ 55-62
>
>IF STATEMENTS:
>IF (STATUS = 'M' AND VOLSER NE '.' AND DSN NE ' '
>   OR LOCATION NE 'OAM' OR LOCATION NE 'DYLT');
>
>I do not want any Locations of OAM or DYLT. BUT, I am getting records for
>them and also records where the VOLSER and DSN fields are blanks.
>
>What's wrong with this code?

Just about everything, frankly.

Why don't you say exactly what you are interested in, instead of 
(erroneaously) saying what you do not want? Positive logic is invariably 
easier to understand and debug than negative logic. And if you really have 
no option but to exclude what you do not want, then state the condition of 
what you do not want and throw those that fit out. And in any case: use 
parantheses to explicitely say what the order of precedence of the 
predicates is.

IF (STATUS = 'M' AND VOLSER NE '.' AND DSN NE ' ');
IF (LOCATION EQ 'OAM' OR LOCATION EQ 'DYLT')
  THEN DELETE;

should do the trick...

Cheers,

Jantje.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to