Use DECLARE CURSOR statement either in working storage or in procedure division (before open cursor), to specify the SELECT statement.  Then use OPEN, FETCH rows in a loop and finally CLOSE.
  • No Related Post