Apparently db2 provides two forms of an error message, one more readable
then the other. The readable one is apparently parsed from the other
one. When db2 parses the error message shown below, it lets the extra
semicolons confuse it. I believe the correct parse to be (especially
because when I deleted the semicolon in question the procedure compiled):
An unexpected token ";" was found following "turn str_out;
end". Expected tokens may include: "END-OF-STATEMENT"
The actual error message was:
DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: ;;turn str_out;
end;END-OF-STATEMENT
Message: An unexpected token "" was found following "". Expected tokens
may include: "turn str_out".