The PTOA function converts a number from numeric format to alphanumeric format. It retains the decimal positions of the number and right-justifies it with leading spaces. You can also add edit options to a number converted by PTOA.
When using PTOA to convert a number containing decimals to a character string, you must specify an alphanumeric format large enough to accommodate both the integer and decimal portions of the number. For example, a P12.2C format is converted to A14. If the output format is not large enough, the right-most characters are truncated.
PTOA(number, '(format)', output)
Numeric P (packed-decimal) or F or D (single and double precision floating-point)
Is the number to be converted.
Is the format of the number enclosed in parentheses.
The length of this argument must be greater than the length of number and must account for edit options and a possible negative sign.
PTOA converts PGROSS from packed-decimal to alphanumeric format.
PTOA(PGROSS, FMT, 'A17')