CAST is a complex function that transforms one or more values from one data type into another.
.-<< , <<-----------.
V |
>>-CAST--(----source_expression +-- AS--DataType---------------->
>--+-------------------+--+----------------------+-------------->
'-CCSID--expression-' '-ENCODING--expression-'
>--+--------------------+--+---------------------+--)----------><
'-FORMAT--expression-' '-DEFAULT--expression-'
In practice, you cannot specify all of the above parameters at the same time. For example, CCSID and ENCODING parameters take effect only on string-to-string conversions, while FORMAT applies only to string-numeric and string-datetime conversions (in either direction).
Login to rate this answer.