DATA[n]
A "packed hexadecimal" data block of n bytes, zero padded (not space-padded). If n is omitted, the DATA is variable length to the size needed to contain the result of the cast or passed parameter. Type casting is allowed but only to a STRING or UNICODE of the same number of bytes.
This type is particularly useful for containing BLOB (Binary Large OBject) data. See the Programmer's Guide article Working with BLOBs for more information on this subject.
The upper size limit for any DATA value is 4GB.
Fields can optionally have a LENGTHSIZE attribute to specify the number of bytes (1, 2, or 4) used to store a variable-length field's length prefix. The default is 4 bytes. This is useful for reducing memory usage for small variable-length data blocks. If a longer data block is assigned, it will be truncated.
Example:
DATA8 MyHexString := x'1234567890ABCDEF';
// an 8-byte data block - hex values 12 34 56 78 90 AB CD EF
OUTPUT(MyHexString);