I feel parentheses and indentation make things clearer.
IF ( ITEM = 500
AND ( ACODE > 29 )
AND ( ACODE < 41 ) )
OR ( ( ITEM NOT = 500 )
AND ( ( ACODE > 0 AND < 21 )
OR ( ACODE > 50 AND < 71 )
OR ( ACODE > 85 AND < 90 )
OR ( ACODE > 95 AND < 100 ) ) )
stuff
END-IF
I do even do that "inner AND". As an AND, as Robert says, it will work exactly without the parentheses, but, and although it won't happen in this example, with a small change to the test, and then the need to change the AND to an OR, things go awry.
IF (ITEM = 500 AND ACODE = 29 OR ACODE = 41)
stuff
END-IF
Without parentheses that operates as ITEM = 500 and ACODE = 29, OR, entirely separately and on its own, nothing to do with ITEM, ACODE = 41.
Better anyway with 88s.
Here are the data definitions and 88s I invented. Note how the 88s give descriptive power to the code.
01 ACODE PIC 999.
88 CODE-FOR-MEDIUM-VALUE VALUE 29 THRU 41.
88 CODE-FOR-SMALL-VALUE VALUE 0 THRU 21.
88 CODE-FOR-HIGH-VALUE VALUE 50 THRU 71.
88 CODE-FOR-LUXURY-VALUE VALUE 85 THRU 90.
88 CODE-FOR-SUPERLUX VALUE 95 THRU 100.
88 CODE-FOR-ANALYSIS VALUE 0 THRU 21
50 THRU 71
85 THRU 90
95 THRU 100.
01 ITEM PIC 999.
88 ITEM-IS-MANAGERS-SPECIAL VALUE 500.
IF ( ITEM-IS-MANAGERS-SPECIAL
AND CODE-FOR-MEDIUM-VALUE )
OR ( NOT ( ITEM-IS-MANAGERS-SPECIAL ) )
AND ( CODE-FOR-SMALL-VALUE
OR CODE-FOR-HIGH-VALUE
OR CODE-FOR-LUXURY-VALUE
OR CODE-FOR-SUPERLUX )
stuff
END-IF
Better with one 88 for all four tests in the second part:
IF ( ITEM-IS-MANAGERS-SPECIAL
AND CODE-FOR-MEDIUM-VALUE )
OR ( CODE-FOR-ANALYSIS
AND ( NOT ITEM-IS-MANAGERS-SPECIAL ) )
stuff
END-IF
Then why not a quiet "nested IF", (or an EVALUATE with two tests).
IF ITEM-IS-MANAGERS-SPECIAL
IF CODE-FOR-MEDIUM-VALUE
stuff
END-IF
ELSE
IF CODE-FOR-ANALYSIS
same stuff as immediately above
END-IF
END-IF
Of course, I'd have all the "stuff" as a PERFORM (generally).