SMOD (IND1) = 'B' OR 'R' means (SMOD (IND1) = 'B') OR (SMOD (IND1) = 'R'); syntax for implied comparands exists in other languages as well.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List [[email protected]] on behalf of Paul Gilmartin [[email protected]] Sent: Friday, June 5, 2020 4:32 PM To: [email protected] Subject: Re: COBOL Question On Fri, 5 Jun 2020 20:17:06 +0000, Gibney, Dave wrote: >Using OP > IF TVOLL (IND1) NOT = HIGH-VALUE > AND SMOD (IND1) = 'B' OR 'R' > >I would do > IF TVOLL (IND1) NOT = HIGH-VALUE > IF SMOD (IND1) = 'B' OR 'R' > Do the stuff > I have (almost) never coded COBOL, so I have trouble wrapping my head around: SMOD (IND1) = 'B' OR 'R' Does it mean: ( SMOD (IND1) = 'B' ) OR 'R' or SMOD (IND1) = ( 'B' OR 'R' ) or (implied Distributive Law): SMOD (IND1) = 'B' OR SMOD (IND1) = 'R' I'd have even more trouble with: SMOD (IND1) NOT = 'B' OR 'R' SMOD (IND1) NOT = 'B' OR SMOD (IND1) NOT = 'R' ... which seems to be a verbose expression for TRUE. I've seen programmers fall into that trap. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
