Hi Pablo,
most probably the sequence of statements is wrong. The SET OTIONS statement should be the first SQL statement in your program.
EXEC SQL SET OPTION CLOSQLCSR = *ENDACTGRP END-EXEC.
This line works absolutely fine, when placed as the first line in your PROCEDURE DIVISION.
HTH
Daniel