Previous Topic Next topic Print topic


Widechar (n) Varying

Widechar (n) Varying is a wide character-string variable. The VARYING attribute causes the string variable to hold values of varying length. The representation of a varying string variable in storage is such that any string up to n wide characters may be held by the variable, and the length of the current string is retained as part of the value. Widechar (n) Varying is stored as follows: the first two bytes contain the length of the string (represented by a Fixed Binary (15) number stored in machine native format) followed by a sequence of wide characters stored as 1 wide character (or "byte-pair") in adjacent bytes (Big Endian order). In Open PL/I, the maximum length of a wide string value is 16383 characters.

Widechar (n) Varying byte table

Size Alignment
n*2+2 bytes    Half-word
Previous Topic Next topic Print topic