0 - 3 of 3 tags for exit handler

Problem statement:

 

We want to set custom SQLSTATE in Teradata stored procedures. The only way to set custom SQLSTATE value is through external stored procedure.

 

How to handle exceptions raised within the cursor iteration? Basically what I have here is a For cursor and I want to handle the exception and exit the for loop. The exception handling are MULTIPLE SQL statements which cleans up and record error messages. The Teradata documentation's example shows only one SQL statement for handler action statement. I tried to enclose multiple by using BEGIN ... END block the code looks like this
exception handling syntax is:

/*** Previous logic codes here **/
BEGIN --(1)begin the block for record process and error handling