35 lines
695 B
Plaintext
35 lines
695 B
Plaintext
Paragraphs, sections and statements must be correctly indented for better code readability.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,cobol]
|
|
----
|
|
IDENTIFICATION DIVISION.
|
|
PROGRAM-ID. foo.
|
|
|
|
PROCEDURE DIVISION.
|
|
IF "foo" = "bar" THEN
|
|
DISPLAY "foo = bar!" *> Noncompliant
|
|
ELSE
|
|
DISPLAY "foo <> bar!". *> Noncompliant
|
|
END PROGRAM foo.
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
[source,cobol]
|
|
----
|
|
IDENTIFICATION DIVISION.
|
|
PROGRAM-ID. foo.
|
|
|
|
PROCEDURE DIVISION.
|
|
IF "foo" = "bar" THEN
|
|
DISPLAY "foo = bar!"
|
|
ELSE
|
|
DISPLAY "foo <> bar!".
|
|
END PROGRAM foo.
|
|
----
|
|
|