ENTMF 

Comparisons of Dynamic-Length Elementary Items

General Format:

Dynamic Length Comparisons

General Rules:

  1. Dynamic-length items are handled as though they are fixed length items whose length is equal to the current length.

Example

Taking the following two dynamic-length elementary items:

01 color1 PIC X DYNAMIC.
01 color2 PIC X DYNAMIC.

You can compare the two items as follows:

MOVE "gray " to color1.
MOVE "gray" to color2.
IF color1 IS EQUAL TO color2 THEN
   DISPLAY "color match"
ELSE
   DISPLAY "color mismatch"
END-IF.

The result is color match, because even though the lengths of color1 and color2 differ, their contents are the same.