Re: Data Name = to more than one number
From: Chuck Stevens (charles.stevens_at_unisys.com)
Date: 02/10/04
- Next message: Howard Brazee: "Re: Data Name = to more than one number"
- Previous message: KL: "Re: Data Name = to more than one number"
- In reply to: KL: "Data Name = to more than one number"
- Next in thread: Howard Brazee: "Re: Data Name = to more than one number"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 10 Feb 2004 07:36:41 -0800
As an unrelenting foe of the "Abbreviated Combined Relation Condition" I'm
reluctant to bring this up. But the following is valid COBOL:
IF ORDER-ITEM-SERIES = '1' OR '2'
PERFORM FIRST-DISC
ELSE IF ORDER-ITEM-SERIES = '3' OR '4' OR '5'
PERFORM SECOND-DESC
...
In the general case I loathe the convention, largely because of the tendency
to think that abbreviation of a condition implies that the act of
abbreviation impacts the precedence of the logical operators in the
expression (it doesn't), in addition to the fact that it's kind of at the
"trailing edge" of COBOL logic design technology. I have on several
occasions lobbied at J4 in opposition to the proliferation of abbreviated
conditions in future COBOL standards beyond where they are now permitted.
However, in this particular instance the abbreviation is unambiguous and
clear.
-Chuck Stevens
"KL" <klbjornme@aol.com> wrote in message
news:e7ccb54b.0402092010.1baa8164@posting.google.com...
> I need to know how to code when I have a data name that I want to use
> in an IF statement, but make it equal to more than one number. Is
> there an easier way to do this, other than the way I have in the
> following?
>
> IF ORDER-ITEM-SERIES = '1' OR ORDER-ITEM-SERIES ='2'
> PERFORM FIRST-DISC
> ELSE
> IF ORDER-ITEM-SERIES = '3' OR ORDER-ITEM-SERIES = '4'
> ORDER-ITEM-SERIES = '5'
> PERFORM SECOND-DISC
> ELSE
> CONTINUE
> END-IF.
> END-IF.
>
> As you can see, the nested IF statement becomes longer than 72, which
> makes it harder to code. I am just learning (well relearning, but
> it's been over 10 years). Any help would be greatly appreciated.
>
> KL
- Next message: Howard Brazee: "Re: Data Name = to more than one number"
- Previous message: KL: "Re: Data Name = to more than one number"
- In reply to: KL: "Data Name = to more than one number"
- Next in thread: Howard Brazee: "Re: Data Name = to more than one number"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]