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...
DECLARE V_SUM DECIMAL (10, 2) DEFAULT 0.0;
FOR I AS SELECT SALARY FROM EMPLOYEES
SET V_SUM = V_SUM + I.SALARY;