POWER
Synopsis
POWER(numericexpression,power) {fn POWER(numericexpression,power)}
Arguments
Argument  Description 

numericexpression  The base number. Can be a positive or negative integer or fractional number. 
power  The exponent, which is the power to which to raise numericexpression. Can be a positive or negative integer or fractional number. 
Description
POWER calculates one number raised to the power of another. It returns a value of data type DECIMAL with a precision of 36 and a scale of 18.
Note that POWER can be invoked as an ODBC scalar function (with the curly brace syntax) or as an SQL general scalar function.
POWER interprets a nonnumeric string as 0 for either argument. For further details, refer to Strings as Numbers. POWER returns NULL if passed a NULL value for either argument.
All combinations of numericexpression and power are valid except:

POWER(0,m): a 0 numericexpression and a negative power results in an SQLCODE 400 error.

POWER(n,.m): a negative numericexpression and a fractional power results in an SQLCODE 400 error.
Examples
The following example raises 5 to the 3rd power:
SELECT POWER(5,3) AS Cubed
returns 125.
The following embedded SQL example returns the first 16 powers of 2:
SET a=1
WHILE a<17 {
&sql(SELECT {fn POWER(2,:a)}
INTO :b)
IF SQLCODE'=0 {
WRITE !,"Error code ",SQLCODE
QUIT }
ELSE {
WRITE !,"2 to the ",a," = ",b
SET a=a+1 }
}