42 lines
812 B
Plaintext
42 lines
812 B
Plaintext
``++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)
|
||
|
||
include::message.adoc[]
|
||
|
||
'''
|
||
== Comments And Links
|
||
(visible only on this page)
|
||
|
||
include::comments-and-links.adoc[]
|
||
endif::env-github,rspecator-view[]
|