rspec/rules/S3671/cobol/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

47 lines
975 B
Plaintext

== Why is this an issue?
When the size of a variable-length table is ``++DEPENDING ON++`` a non-``++BINARY++``/``++COMP++`` variable, use of that table is inefficient because a conversion must be done every time the table is used.
=== Noncompliant code example
[source,cobol]
----
01 VARS
05 TABLE_SIZE PIC 9(4).
05 MY_TABLE OCCURS 1 TO 10
DEPENDING ON TABLE_SIZE *> Noncompliant; TABLE-SIZE isn't BINARY or COMP
PIC X(10).
----
=== Compliant solution
[source,cobol]
----
01 VARS
05 TABLE_SIZE PIC 9(4) BINARY.
05 MY_TABLE OCCURS 1 TO 10
DEPENDING ON TABLE_SIZE
PIC X(10).
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use a "BINARY" variable to set the size of this table; "xxx" is a non-binary variable.
=== Highlighting
``++xxx++``
endif::env-github,rspecator-view[]