Problem:
"COBCH1613 : Syntax error. RETURNING not allowed." error is returned when compiling code using RETURNING as a clause of the PROCEDURE DIVISION.
The clause EXTERNAL has been used in the PROGRAM-ID statement - but the compile still fails.
Resolution:
The code expects the value of retcode to be the return value of the program, but this does not happen.
In Studio Enterprise Edition version 5.1 and 6.0, the internal checker allowed the "returning variable-name" clause on the procedure division header, although it did nothing with it.
In order to get the same behaviour as seen in Studio Enterprise Edition 5.1 and 6.0, the "returning retcode" clause needs to be deleted from the procedure division header.
#MFDS
#EnterpriseDeveloper