ICONVS function
Syntax
ICONVS (dynamic.array, conversion)
CALL -ICONVS (return.array, dynamic.array, conversion)
CALL !ICONVS (return.array, dynamic.array, conversion)
Description
Use the ICONVS function to convert each element of dynamic.array to a specified internal storage format.
conversion is an expression that evaluates to one or more valid conversion codes, separated by value marks (ASCII 253).
Each element of dynamic.array is converted to the internal format specified by conversion and is returned in a dynamic array. If multiple codes are used, they are applied from left to right. The first conversion code converts the value of each element of dynamic.array. The second conversion code converts the value of each element of the output of the first conversion, and so on.
If dynamic.array evaluates to the null value, null is returned. If an element of dynamic.array is the null value, null is returned for that element. If conversion evaluates to the null value, the ICONV function fails and the program terminates with a run-time error message.
If you use the subroutine syntax, the resulting dynamic array is returned as return.array.
The STATUS function reflects the result of the conversion:
- 0
- The conversion is successful.
- 1
- An element of dynamic.array is invalid. An empty string is returned, unless dynamic.array is the null value, in which case null is returned.
- 2
- conversion is invalid.
- 3
- Successful conversion of possibly invalid data.
For information about converting elements in a dynamic array to an external format, see the OCONVS function.