In DB2, we can create ananymous blocks to write PL SQL code..
The following is the code snippet to sum up the salaries with out using SUM inbuilt function...
BEGIN
DECLARE V_SUM DECIMAL (10, 2) DEFAULT 0.0;
FOR I AS SELECT SALARY FROM EMPLOYEES
DO
SET V_SUM = V_SUM + I.SALARY;
END FOR;
END@