Re: IF statement, I don't understand this



In article <ei0o22ded2kaouio80f0ui1bjq2fkb6qo3@xxxxxxx>,
Howard Brazee <howard@xxxxxxxxxx> wrote:

[snip]

IF (SHH-SHIP-CODE = 5
AND ASM010-I-DIR = "L" )
OR ASM010-I-DIR = "R"
OR ASM010-I-DIR = "S"
or even
IF (
SHH-SHIP-CODE = 5
AND ASM010-I-DIR = "L"
)
OR ASM010-I-DIR = "R"
OR ASM010-I-DIR = "S"

With a compiler that accepts in-line comments, this method has another
advantage - we can say what "R" means!

In the Oldene Dayse I saw code that used to do similar things with
88-level conditions, viz.:

01 SHH-SHIP-CODE PIC 9 VALUE ZERO.
88 SEND-BY-DEFAULT-METHOD VALUE ZER0.
88 SEND-BY-MULE VALUE 1.
88 SEND-BY-BANANA-BARGE VALUE 2.
88 SEND-BY-CARRIER-PIGEON VALUE 3.
88 SEND-BY-PASSENGER-PIGEON VALUE 4.
88 SEND-BY-VELOCIPEDE-COURIER VALUE 5.
88 SEND-BY-PONY-EXPRESS VALUE 6.
88 SEND-BY-KINGS-POST VALUE 7.
88 SEND-BY-STAGECOACH VALUE 8.
88 SEND-BY-INDENTURED-SERVANT VALUE 9.

.... old code, granted... but it seemed to work and avoided hardcoding
values in the PROCEDURE DIVISION.

(Yes, I know that passenger pigeons didn't actually carry things... but
maybe some Corner Office Idiot said 'Well, maybe if they don't have any
passengers we can get them to carry freight' so someone had to code for
it.)

DD

.



Relevant Pages

  • Re: IF statement, I dont understand this
    ... 88-level conditions, viz.: ... 88 SEND-BY-PASSENGER-PIGEON VALUE 4. ... I know that passenger pigeons didn't actually carry things... ... Carrier Pigeon? ...
    (comp.lang.cobol)
  • Re: IF statement, I dont understand this
    ... 88-level conditions, viz.: ... 88 SEND-BY-PASSENGER-PIGEON VALUE 4. ... I know that passenger pigeons didn't actually carry things... ... Carrier Pigeon? ...
    (comp.lang.cobol)