Varying keywords are used in D specs with character, graphic, and UCS-2 fields to make them variable-length fields. A 2-byte integer field gets added at the start of the field using the VARYING keyword. That 2-byte integer contains the length of the data in the varying field. For example,
D FLDA1 S 10 VARYING
In storage, the data in hex format would look like 0004E3C5E2E3404040404040. Here, 0004 is the hex value for decimal 4 that represents the length of data in the fld1. Hex value E3 is character ‘T’, C5 is ‘E’ and E2 is ‘S’, and 40 is space.
Varying keywords are used in D specs with character, graphic, and UCS-2 fields to make them variable-length fields. A 2-byte integer field gets added at the start of the field using the VARYING keyword. That 2-byte integer contains the length of the data in the varying field. For example,
In storage, the data in hex format would look like 0004E3C5E2E3404040404040. Here, 0004 is the hex value for decimal 4 that represents the length of data in the fld1. Hex value E3 is character ‘T’, C5 is ‘E’ and E2 is ‘S’, and 40 is space.