%UNS(numeric or character expression)
%UNS converts the value of the expression to unsigned
format. Any decimal digits are truncated. %UNS can be used to
truncate the decimal positions from a float or decimal value allowing
it to be used as an array index.
If the parameter is a character expression, the following
rules apply:
- The sign is optional. It can only be '+' . It can precede or follow
the numeric data.
- The decimal point is optional. It can be either a period or a
comma.
- Blanks are allowed anywhere in the data. For example, ' + 3
' is a valid parameter.
- Floating point data is not allowed. That is, where the numeric
value is followed by E and an exponent, for example '1.2E6'.
- If invalid numeric data is found, an exception occurs with status
code 105
For more information, see Conversion Operations or Built-in Functions.
Figure 1 shows an example of the %UNS built-in function.