Occasionally one might run across the following warning when compiling a program.
"Unexpected level number for <dataItem>"
This happens when the compiler comes across a data item that does not have its level number in sequence.
For e.g. consider the following definition.
01 var1.
02 var2.
05 var5A pic x(2).
05 var5B pic x(2).
03 var3 pic x(2).
02 var2B pic x(2).
In the above case var3 whose parent level is var2 will be treated as a sibling to var5A and var5B .
The compiler will generate a warning "Unexpected level number for var3".
Even though the code compiles with the warning, it is recommended for program clarity to resolve such issues.
Proper coding would require that var3 be defined as level 05 instead of level 03 as shown below.
01 var1.
02 var2.
05 var5A pic x(2).
05 var5B pic x(2).
05 var3 pic x(2).
02 var2B pic x(2).
0 Comments