Hello, I'm getting the following error on the 'OUTPUT' procedure of the internal sort,
'RETURN statement 2267 out of order'.
Cause . . . . . : The RETURN statement was not expected by SORT/MERGE. Either a SORT/MERGE was not active or the statement was issued out of sequence. Message issued at statement 2267 of COBOL program 'IAHF910' in program object 'IAHF910' in library 'IAHFOBJ'.
Recovery . . . : Remove the RETURN statement or place it in proper order.
I verified using STRDBG that the INPUT procedure is running and SORT records are being released.
SORT SORT-FILE ASCENDING KEY SREC-KEY INPUT PROCEDURE P1000-DECLARE-TXN-SALE OUTPUT PROCEDURE P2000-READ-SORT.
The code appears to fine in the 'OUTPUT' procedure, and the return is in the correct place,
P2000-READ-SORT. RETURN SORT-FILE AT END PERFORM P2100-UPDATE-SAVE-RECORD THRU P2199-EXIT GO TO P2199-EXIT.
This code apparently ran fine on a Mainframe. I'm on a project to convert all applications to the i. Any help or suggestions would be appreciated.
Thank you
Software/Hardware used:
AS/400 iSeries version 6.1
ASKED:
September 10, 2009 8:44 PM
UPDATED:
September 17, 2009 7:47 PM
The program has been imported to the i, and necessary changes have been made for the new environment.
The program has compiled on the i, the error is occuring on execution.
We have several programs with the the same ‘internal sort’ logic that are running fine on the i.
It’s very strange.
IBM doesn’t offer information as far as the error goes.
Interesting. I assume that some changes to the source code were required when you moved it to the i. (By the way, what is “the i?”) Is it possible the the RETURN is being executed out of sequence? A stray branch instruction, perhaps, is causing it to be executed before it should be (or executed twice)?
Other than that, I don’t know what to suggest.
After further investigation there were changes made to the source. I re-imported the original code and recompiled and there is no longer an issue.
BTW, an i is the same as the iSeries or AS/400.
I appreciate your input.
Thanks.
Hey, glad you found it.