2023-05-03 11:06:20 +02:00
== Why is this an issue?
2021-04-28 16:49:39 +02:00
Using more than one ``++OF++`` clause to access a data item can quickly decrease the readability of the source code. Either some ``++OF++`` clauses are optional and should be removed, or there are too many intersections between several data structures and those intersections should be removed.
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 EMPLOYEE.
05 MOTHER-IN-LAW.
10 NAME PIC X(20).
05 FATHER-IN-LAW.
10 NAME PIC X(20).
...
01 CUSTOMER.
05 MOTHER-IN-LAW.
10 NAME PIC X(20).
05 FATHER-IN-LAW.
10 NAME PIC X(20).
...
MOVE MY_VALUE TO NAME OF MOTHER-IN-LAW OF CUSTOMER
----
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
* Refactor the "YYY" data structure to be able to access to "XXXX" with at most one "OF" clause
* Remove the optional "OF" clauses from this qualified data name to access to "XXXX" with at most one "OF" clause
2021-09-20 15:38:42 +02:00
endif::env-github,rspecator-view[]