include::../description-common.adoc[]

=== Code examples

==== Noncompliant code example

[source,cobol,diff-id=1,diff-type=noncompliant]
----
   IF BAR = 4
*  Noncompliant: due to the nesting IF statement, we know that BAR = 4 here and so 
*  what's the point of testing again that BAR = 4 ?
     IF FOO = "a" AND BAR = 4
       DISPLAY "something"
     END-IF.
     ...
   END-IF 
----

[source,cobol,diff-id=2,diff-type=noncompliant]
----
*  Noncompliant: by definition BAR is greater than 0 if BAR = 4, 
*  so the condition BAR > 0 should be removed
   IF BAR = 4 AND > 0 THEN DISPLAY "something".
----

==== Compliant solution

[source,cobol,diff-id=1,diff-type=compliant]
----
   IF BAR = 4
     IF FOO = "a"
       DISPLAY "something"
     END-IF.
     ...
   END-IF 
----

[source,cobol,diff-id=2,diff-type=compliant]
----
   IF BAR = 4 THEN DISPLAY "something".
----

include::../see.adoc[]

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

include::../highlighting.adoc[]

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
