Returns a character string which contains the hexadecimal representation of the storage at a specified location.
HEXIMAGE(p,n,c)
p is a restricted expression that must have a locator type. Note that if it is OFFSET, it must have the AREA attribute. n is an expression that must have a computational type and is converted to Fixed Binary(31,0). c is an expression that is optional and must have CHARACTER (1) NONVARYING.
dcl s char (32) varying; s = 'The witch cast a terrible spell.'; display (trim(length(s))); display (heximage(addr(s), length(s) + 2)); display (heximage(addrdata(s), length(s), '+'));
Prints:
32 200054686520776974636820636173742061207465727269626C65207370656C6C2E 54686520+77697463+68206361+73742061+20746572+7269626C+65207370+656C6C2E
32 002054686520776974636820636173742061207465727269626C65207370656C6C2E 54686520+77697463+68206361+73742061+20746572+7269626C+65207370+656C6C2E
Note the leading fixed bin (15) length field 2000 vs 0020 as stored on the native architectures.
None.