2023-05-03 11:06:20 +02:00
== Why is this an issue?
2021-04-28 16:49:39 +02:00
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.
2021-04-28 18:08:03 +02:00
2023-05-03 11:06:20 +02:00
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
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).
----
2021-04-28 18:08:03 +02:00
2023-05-03 11:06:20 +02:00
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
01 VARS
05 TABLE_SIZE PIC 9(4) BINARY.
05 MY_TABLE OCCURS 1 TO 10
DEPENDING ON TABLE_SIZE
PIC X(10).
----
2021-04-28 18:08:03 +02:00
2021-09-20 15:38:42 +02:00
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== Message
Use a "BINARY" variable to set the size of this table; "xxx" is a non-binary variable.
=== Highlighting
``++xxx++``
2021-09-20 15:38:42 +02:00
endif::env-github,rspecator-view[]