HEXIMAGE Function

Purpose

Returns a character string which contains the hexadecimal representation of the storage at a specified location.

Syntax

HEX(x,y)

Parameters

x is a variable and y is an expression that must have a nonvarying character type.

Description

HEXIMAGE returns a character string that is the hexadecimal representation of n bytes of storage at location p, whose length is one of the following.
  • 2 * n, when used as HEXIMAGE(p,n).
  • When using HEXIMAGE(p,n,z), with character z inserted between every set of eight characters in the output string, its length is (2 * n) + ((n - 1)/4).

Example

dcl X fixed bin(15) littleendian;
dcl Y fixed bin(15) bigendian;

X = 258; 																																												/* stored as ’0201’B4 */
Y = 258; 																																												/* stored as ’0102’B4 */

display (hex(X)); 																																			/* displays 0102 */
display (hex(Y)); 																																			/* displays 0102 */

display (heximage( addr(X), stg(X) )); 														/* displays 0201 */
display (heximage( addr(Y), stg(Y) )); 														/* displays 0102 */

Restrictions

None.