rspec/rules/S1683/cobol/rule.adoc

88 lines
2.2 KiB
Plaintext

== Why is this an issue?
Copybooks should be used only to share data definitions or logic. The following keywords relate to the nature or structure of a COBOL program, and should be defined directly in the source code of the COBOL program:
* ``++IDENTIFICATION DIVISION.++``
* ``++PROGRAM-ID xxxxxxxx.++``
* ``++AUTHOR. yyyyyyyyyyy.++``
* ``++INSTALLATION. zzzzzz.++``
* ``++DATE-WRITTEN. zzzzzz.++``
* ``++DATE-COMPILED. zzzzzz.++``
* ``++ENVIRONNEMENT DIVISION.++``
* ``++CONFIGURATION SECTION.++``
* ``++SOURCE-COMPUTER. xxxxxx.++``
* ``++OBJECT-COMPUTER. xxxxxx.++``
* ``++SPECIAL-NAMES. DECIMAL-POINT IS COMMA.++``
* ``++I-O CONTROL.++``
* ``++FILE-CONTROL.++``
* ``++DATA DIVISION.++``
* ``++FILE SECTION.++``
* ``++WORKING-STORAGE SECTION.++``
* ``++SCREEN.++``
* ``++REPORT.++``
* ``++INPUT-OUTPUT SECTION.++``
* ``++LINKAGE SECTION.++``
* ``++PROCEDURE DIVISION.++``
=== Noncompliant code example
[source,cobol]
----
IDENTIFICATION DIVISION.
DATA DIVISION.
LINKAGE SECTION.
COPY CSCEMOD1.
MOVE A TO B.
----
=== Compliant solution
[source,cobol]
----
IDENTIFICATION DIVISION.
DATA DIVISION.
LINKAGE SECTION.
COPY CSCEMOD1.
PROCEDURE DIVISION.
COPY CSCEMOD2.
MOVE A TO B.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* Move the declaration of "XXX" from copybook "YYYY" to this program
* Move the declaration of "XXX" from this copybook to the calling program(s)
'''
== Comments And Links
(visible only on this page)
=== on 19 May 2014, 15:35:40 Freddy Mallet wrote:
Be careful, the issues must be logged on the calling programs and not on copybooks.
=== on 19 May 2014, 15:39:57 Ann Campbell wrote:
I don't understand why [~freddy.mallet]
=== on 20 May 2014, 10:01:00 Freddy Mallet wrote:
Because in fact a remediation action is required on each COBOL program including the copybook.
=== on 28 May 2014, 09:28:10 Pierre-Yves Nicolas wrote:
COBOL-1061 specifies that the issue should be logged both on the copybook and on the calling program. I think we therefore need 2 different messages. Can you please validate that? Thanks.
=== on 28 May 2014, 11:36:18 Ann Campbell wrote:
\[~pierre-yves.nicolas] check the message(s) now
endif::env-github,rspecator-view[]