When writing a post in http://natural.forums.softwareag.com/viewtopic.php?p=1457#1457 about EXPAND/REDUCE/RESIZE of X-arrays I read the documentation more attentive and found out that these statements, at least for dynamic variables, are useless, as they have influence on the allocated storage, not the length of the value (*length is not modified unless the new allocated storage is less than the previous length of the value). The documentation says:
So, when you RESIZE (analog EXPAND/REDUCE) you advise NATURAL to reserve the specified space.
So after RESIZE you indeed can not rely on the specified space. I.e. what you did was useless.
To acquire the needed space and to reflect this in *length I am used to use MOVE ALL:
DEFINE DATA LOCAL 1 DYNVAR (A) DYNAMIC END-DEFINE EXPAND DYNAMIC DYNVAR TO 70 DISPLAY *LENGTH(DYNVAR) 'EXPAND' MOVE ALL ' ' TO DYNVAR UNTIL 70 DISPLAY *LENGTH(DYNVAR) 'MOVE ALL' END
But keep in mind that any following value assignment may change *length.
I am looking forward to the discussion!