COBCH0384 NEXT SENTENCE does not follow ON, IF, ELSE or SEARCH WHEN

NEXT SENTENCE should be used only in either branch of an IF statement or the WHEN branch of a SEARCH statement.

Resolution:

Revise your code to ensure that you have obeyed these rules.