INITIALIZE statement
Consider the following example:
01 ALPHA PIC AABAABAA.
INITIALIZE ALPHA REPLACING ALPHABETIC DATA BY ALL "3".
A statement like this coded under CMPR2 is valid and initialization
will take place. However, this statement gives the following warning
message under NOCMPR2, and no initialization will take effect:
- IGYPS2047-W
- "INITIALIZE" statement receiver "ALPHA" was incompatible with the data category(s) of the "REPLACING" operand(s). "ALPHA" was not initialized.
This incompatibility can also happen when a group of items are being initialized. Under NOCMPR2,
ALPHA mentioned earlier would be classified as alphanumeric-edited. If ALPHA was defined in a group
that was to be initialized, a message like the one mentioned earlier would be issued only if there
were no alphabetic items to be initialized. Thus, in the following example, ALPHA is never
initialized, but no message alerts you to that fact.
01 GROUP1.
05 ALPHA PIC AABAA.
05 BETA PIC AAA.
INITIALIZE GROUP1 REPLACING ALPHABETIC DATA BY ALL "5".