         AOP_block_body(i_level => i_level + 1);
       WHEN l_keyword = 'BEGIN' THEN
         AOP_block_body(i_level => i_level + 1);
+	  WHEN l_keyword LIKE 'CASE%END CASE;' THEN
+	    ms_logger.comment(l_node, 'Found CASE-END-CASE;');
+		go_past('\sCASE\s');  
+	  WHEN l_keyword LIKE 'CASE%END;' THEN
+	    ms_logger.comment(l_node, 'Found CASE-END;');
+		go_past('\sEND;\s'); 
       ELSE
-	    ms_logger.fatal(l_node, 'Expected "DECLARE", "BEGIN", "END;"');
+	    ms_logger.fatal(l_node, 'Expected "DECLARE" "BEGIN" "END;" "CASE%END CASE;" or "CASE%END;"');
         RAISE x_invalid_keyword;
     END CASE;
  

	  --Reset the processing pointer.
      g_current_pos := 1;
 
      loop
	    l_end_value := get_next_upper( '\sEND\s+\w+\s*;');   
		EXIT WHEN l_end_value IS NULL;
	    ms_logger.note(l_node, 'l_end_value'      ,l_end_value);
 

	    if l_mystery_word in ('IF'
	                         ,'LOOP'
	    					 ,'CASE') then
		  g_code := REGEXP_REPLACE(g_code,l_mask,'\1 \2;',g_current_pos,1,'i');					 	 
		  go_past('END (\w+);');						 
		ELSE						 
	      ms_logger.info(l_node, 'Replacing '||l_end_value);
	      g_code := REGEXP_REPLACE(g_code,l_mask,'\1;',g_current_pos,1,'i');
		  go_past('END;');
	    end if;
 
	  END LOOP;
	end;  
   
  ms_logger.comment(l_node, 'Finised cleaning ENDs');

