rspec/rules/S1307/cobol/rule.adoc

54 lines
1.2 KiB
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
It is fairly normal for COBOL development teams to decide to work either with sections or with paragraphs and to make this choice a standard.
When sections are used, it is also normal to define another standard: "End every section definition with an empty paragraph definition, or a paragraph containing only a terminating statement".
This empty paragraph can then be jumped to with a ``++GO TO++`` statement to stop the execution of a section.
Accepted terminating statements in the otherwise-empty ending paragraph are: ``++EXIT++``, ``++EXIT PROGRAM++``, ``++STOP RUN++``, and ``++GO BACK++``.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
In this example, an empty paragraph is missing at the end of the first section definition.
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
FIRST_SECTION SECTION.
...
SECOND_SECTION SECTION.
...
SECOND_SECTION_END.
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
FIRST_SECTION SECTION.
...
FIRST_SECTION_END.
SECOND_SECTION SECTION.
...
SECOND_SECTION_END.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]