Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Compiler and Runtime Migration Guide


Reference modification of a variable-length group receiver

Programs that MOVE data to reference-modified, variable-length groups might produce different results depending on whether the length used for the variable-length group is evaluated by using the actual length or the maximum length.

You might see a difference if the variable-length group meets all of the following criteria:
For example, Group VAR-LEN-GROUP-A contains an ODO object and an OCCURS subject and is followed by a variably located data item.
01 VAR-LEN-PARENT-A.
   02 VAR-LEN-GROUP-A.
      03 ODO-OBJECT PIC 99 VALUE 5.
      03 OCCURS-SUBJECT OCCURS 10 TIMES DEPENDING ON ODO-OBJECT.
         04 TAB-ELEM  PIC X(4).
   02 VAR-LOC-ITEM  PIC XX.
01 NEXT-GROUP.

MOVE ALL SPACES TO VAR-LEN-GROUP-A(1:).
Group VAR-LEN-GROUP-B contains an ODO object and an OCCURS subject and is not followed by a variably located data item. VAR-LOC-ITEM follows the OCCURS subject, but does not follow VAR-LEN-GROUP-B.
01 VAR-LEN-PARENT-B.
   02 VAR-LEN-GROUP-B.
      03 ODO-OBJECT PIC 99 VALUE 5.
      03 OCCURS-SUBJECT OCCURS 10 TIMES DEPENDING ON ODO-OBJECT.
         04 TAB-ELEM PIC X(4).
      03 VAR-LOC-ITEM PIC XX.
01 NEXT-GROUP.

MOVE ALL SPACES TO VAR-LEN-GROUP-B(1:).

In the above examples, MOVE ALL SPACES TO VAR-LEN-GROUP-A (1:) would give the same results with any NOCMPR2 program (VS COBOL II, Release 3.x, VS COBOL II, Release 4, or Enterprise COBOL). They all use the actual length in this case.

MOVE ALL SPACES TO VAR-LEN-GROUP-B (1:) would give different results for the following programs compiled with NOCMPR2:
If a program contains a reference-modified, variable-length group receiver that contains its own ODO object and is not followed by variably located data and whose reference modifier does not have a length specified, the following message is issued:
IGYPS2298-I
The reference to variable-length group "data name" will be evaluated using the maximum length of the group. Execution results might differ from VS COBOL II, Release 3.x.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)