2021-04-28 16:49:39 +02:00
Initializing a data item with a value of the wrong type will lead to runtime errors. The rule checks that numeric data items are not initialized with alphanumeric/alphabetic values and that alphanumeric /alphabetic data items are not initialized with numeric values.
2021-04-28 18:08:03 +02:00
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
WORKING-STORAGE SECTION.
EJECT
01 TAB-POS.
02 FILLER PIC A(14) VALUE 0. *> Noncompliant
02 FILLER PIC 9(14) VALUE 'ASDFJKL;QWERTY'. *> Noncompliant
01 MYGROUP PIC 9(1).
88 X VALUE 1,2.
88 Y VALUE 3, "BLUE". *> Noncompliant; BLUE is alphanumeric
----
2021-04-28 18:08:03 +02:00
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
WORKING-STORAGE SECTION.
EJECT
01 TAB-POS.
02 FILLER PIC A(14) VALUE 'ASDFJKL;QWERTY'.
02 FILLER PIC 9(14) VALUE 0.
01 MYGROUP PIC 9(1).
88 X VALUE 1,2.
88 Y VALUE 3, 4.
----
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)
include::message.adoc[]
endif::env-github,rspecator-view[]