Available Operating Systems: AS/400, OpenVMS, OS/390, VM/CMS Available Languages: reporting, Maintain | How to: | Example: |
The UFMT function converts characters in an alphanumeric field to the hexadecimal representation. This function is useful for examining data of unknown format. As long as you know the length of the data, you can examine its content.
UFMT(string, inlength, outfield)
where:
string
Alphanumeric
Is the alphanumeric string to be converted enclosed in single quotation marks, or the field that contains the string.
inlength
Numeric
Is the length in characters of string.
outfield
Alphanumeric
Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks. The format of outfield must be alphanumeric and its length must be twice that of inlength.
In Dialogue Manager, you must specify the format. In Maintain, you must specify the name of the field.
UFMT converts each value in JOBCODE to its hexadecimal representation and stores the result in HEXCODE:
DEFINE FILE JOBFILE
HEXCODE/A6 = UFMT(JOBCODE, 3, HEXCODE);
END
TABLE FILE JOBFILE
PRINT JOBCODE HEXCODE
END
The output is:
JOBCODE HEXCODE
‑‑‑‑‑‑‑ ‑‑‑‑‑‑‑
A01 C1F0F1
A02 C1F0F2
A07 C1F0F7
A12 C1F1F2
A14 C1F1F4
A15 C1F1F5
A16 C1F1F6
A17 C1F1F7
B01 C2F0F1
B02 C2F0F2
B03 C2F0F3
B04 C2F0F4
B14 C2F1F4