
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.
52 lines
1.2 KiB
Plaintext
52 lines
1.2 KiB
Plaintext
== Why is this an issue?
|
||
|
||
``++OCCURS DEPENDING ON++`` clauses are complicated to use correctly and do not provide any benefits with regard to memory consumption. It is best to avoid them.
|
||
|
||
|
||
=== Noncompliant code example
|
||
|
||
[source,cobol]
|
||
----
|
||
01 MYTABLEACCOUNT PIC S9(4) BINARY.
|
||
01 MYTABLE.
|
||
05 MYITEM OCCURS 1 to 1000 DEPENDING ON MYTABLEACCOUNT.
|
||
10 MYFIELD1 PIC X(8).
|
||
10 MYFIELD2 PIC S9(4) BINARY.
|
||
----
|
||
|
||
|
||
=== Compliant solution
|
||
|
||
[source,cobol]
|
||
----
|
||
01 MYTABLE.
|
||
05 MYITEM OCCURS 1000.
|
||
10 MYFIELD1 X(8).
|
||
10 MYFIELD2 PIC S9(4) BINARY.
|
||
----
|
||
|
||
|
||
|
||
ifdef::env-github,rspecator-view[]
|
||
|
||
'''
|
||
== Implementation Specification
|
||
(visible only on this page)
|
||
|
||
=== Message
|
||
|
||
Replace this clause with a simple "OCCURS" clause with no "DEPENDING [ON]".
|
||
|
||
|
||
'''
|
||
== Comments And Links
|
||
(visible only on this page)
|
||
|
||
=== on 24 Mar 2017, 17:24:03 Pierre-Yves Nicolas wrote:
|
||
On the web:
|
||
|
||
* "OCCURS DEPENDING ON is best avoided..." (\http://computer-programming-forum.com/48-cobol/58d65724a4bdc95b.htm)
|
||
* "The main purpose of ODO is to increase the efficiency of the Binary Search." (ODO=Occurs Depending On) (\http://ibmmainframes.com/about47790.html)
|
||
|
||
endif::env-github,rspecator-view[]
|