You are here: Functions > ZONED()

ZONED()

ZONED() converts a numeric expression or field value to ASCII ZONED data format.

Use ZONED() to export data to other applications, such as working paper programs, that require zoned data as input.

Note: Traditionally users have also used the ZONED() function to convert a positive numeric value to a character value containing leading zeros (typically for use as key fields like invoice numbers). Analyzer added a more appropriate function for this specific purpose called LFILL(). For more information see LFILL().

Function Format

ZONED(N,#)

N specifies the numeric expression or field value.
# specifies the length of the ASCII ZONED character field.

This data format does not include an explicit decimal point. Leading zeros are added when field length is greater than the number of digits in the numeric field. If the amount is negative, the rightmost character is displayed as a “}” for zero or as a letter between “J” and “R” for the digits one to nine.

Examples

To convert the number -6,448.99 to a ZONED number:

ZONED(-6448.95,11) = "0000064489N"

If the number contains more digits than the actual length specified, Analyzer truncates the leading zeros and/or digits because the length of the input (number) exceeds the length of the output (length). For example:

ZONED(-6448.95,4) = "489N"