How to: |
Available Languages: reporting, Maintain
The ATODBL function converts a number in alphanumeric format to decimal (double-precision) format.
ATODBL(source_string, length, output)
where:
Alphanumeric
Is the string consisting of digits and, optionally, one sign and one decimal point to be converted, or a field or variable that contains the string.
Alphanumeric
Is the two-character length of the source string in bytes. This can be a numeric constant, or a field or variable that contains the value. If you specify a numeric constant, enclose it in single quotation marks, for example '12'.
Double precision floating-point
Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks.
ATODBL converts the EMP_ID field into double-precision format and stores the result in D_EMP_ID:
TABLE FILE EMPLOYEE PRINT LAST_NAME AND FIRST_NAME AND EMP_ID AND COMPUTE D_EMP_ID/D12.2 = ATODBL(EMP_ID, '09', D_EMP_ID); WHERE DEPARTMENT EQ 'MIS'; END
The output is:
LAST_NAME SMITH JONES MCCOY BLACKWOOD GREENSPAN CROSS |
FIRST_NAME MARY DIANE JOHN ROSEMARIE MARY BARBARA |
EMP_ID 112847612 117593129 219984371 326179357 543729165 818692173 |
D_EMP_ID 112,847,612.00 117,593,129.00 219,984,371.00 326,179,357.00 543,729,165.00 818,692,173.00 |