28 lines
496 B
Plaintext
28 lines
496 B
Plaintext
If the same logic is truly needed for both instances, then:
|
|
|
|
* in an `IF` structure they should be combined
|
|
|
|
[source,cobol,diff-id=1,diff-type=compliant]
|
|
----
|
|
IF (X = 1) OR (X <= 10)
|
|
MOVE A TO B.
|
|
PERFORM SECTION1
|
|
ELSE
|
|
PERFORM SECTION2
|
|
END-IF.
|
|
----
|
|
|
|
* for an `EVALUATE`, one should fall through to the other
|
|
|
|
[source,cobol,diff-id=2,diff-type=compliant]
|
|
----
|
|
EVALUATE X
|
|
WHEN 1
|
|
WHEN 3
|
|
MOVE A TO B.
|
|
PERFORM SECTION1
|
|
WHEN 2
|
|
MOVE A TO C.
|
|
PERFORM SECTION2
|
|
END-EVALUATE.
|
|
---- |