Editing rules for PL/I varying length string types

Fields with the PL/I VARYING attribute (VC, VD, and VB) are separated into two fields for Z Data Tools processing. The first field is the current string length field (named "len" in Z Data Tools Headings), and is followed by a second field that contains the string data to be displayed. Each of the string types has the current string length displayed as a FIXED BIN(15) field.

The separated “len” fields created by Z Data Tools for varying strings do not need creation attributes, as the data content determines the “len” value.

In Edit mode, the data string field maximum display width is divided into unprotected characters, up to and including the current length, and a protected area beyond the current length in a non-display mode. VD strings require two character positions for each double-byte value declared for the string, and two character positions for each current length value that is unprotected. BIT strings require one character position in the Edit panel for each bit value in the string. Character positions beyond the current string length are in protected non-display mode for VD and VB types.

The maximum string length for these string types can be declared as a constant or as varying by specifying a REFER variable name that is present in the structure. If declared with a REFER variable for maximum string length, then each record can have different starting positions and data string display widths for that field and any following fields. REFER variables may also be present in the structure to define the bounds or extents of variables declared as dimensioned arrays.

The Edit processing rules for a VARYING field are: