MX and MY Codes

Converting Hexadecimal and ASCII Strings. The MX code converts a character string to its hexadecimal ASCII equivalent; the MY code converts a hexadecimal string to its alphanumeric equivalent.

The MX code converts each character to a two-digit (one byte) hexadecimal number. This code is useful for finding nonprintable characters in strings of data.

The table below shows some examples of the MX and MY conversions. In the first example, the string begins with a CTRL+A, which is converted to its ASCII equivalent (01).

Stored Data

Code

Result of Conversion

CTRL+AABC

MX

01414243

CTRL+\

MX

FC

CTRL+]

MX

FD

CTRL+^

MX

FE

JOHN

MX

4A4F484E

john

MX

6A6F686E

414243

MY

ABC

4A4F484E

MY

JOHN

FC

MY

CTRL+\

Examples of Formatting Data

These sections provide examples of:

Stored Format and Output Format

Formatting Dollar Amounts

Formatting Dates and Times

See Also

Formatting Data

D Code

MT Code

ML and MR Codes

MC Codes

MCDX and MCXD Codes

MX and MY Codes