I am working on mainframe environment using the Database as DB2. Following is the declaration of my cursor.
DECLARE CNTRPT CURSOR FOR
WHEN 10 THEN SET :WS-PAID-CNT = COUNT(*)
WHEN 11 THEN SET :WS-ADJ-CNT = COUNT(*)
WHERE DEPT_DTL.CUST_ID = :PARM-CUST AND
DEPT_DTL.TRNS_CDE = 'P'
GROUP BY DEPT_ID,
ORDER BY DEPT_ID,