Run-unit ended at 70 in YGENSRCR1I when generating a huge CBL ILE function

Document ID : KB000095079
Last Modified Date : 14/05/2018
Show Technical Document Details
The YGENSRC fails and the function remains on the Submit model create request screen.
Upgraded from 2E 6.2 to 8.7, and now reports the following problem after having changed huge CBL functions and resubmitting them for compile.
The YGENSRC fails and the function remains on the Submit model create request screen.
We were able to narrow the problem down checking the following things. As we came from 6.2, we know there was an issue with huge CBL programs failing their compile due to a DTAARA holding a wrong value. We had him check model value YMNTOPTRFA and as the value still read *CBL, we had him change it to the recommended value of *NO.
Restarted the GEN and Compile but the function still remains on the Submit model create request display. The next question we asked him was whether he did CBL or CBL ILE.
Coming from 6.2 where the ILE compiler was not existing, he had worked in CBL, and then manually compiled on the IBM i in CBL ILE.
Now, that a direct generation in CBL ILE is possible in 2E, he changed to CBL ILE. But a check of the QCBLLESRC showed that it had the wrong record length of 92. We told him to create a new SRCPF file with the correct record length for CBL ILE which is 102. He copied the contents into the newly created QCBLLERC and repeated the steps. But then he got an error during compile telling him that user sources could not be found. In fact, he had embedded EXCUSRSRC in his function. He directed the EXCUSRSRC to find the correctly defined QCBLLESRC and at least, this error was gone.
But he still gets the error that the YGENSRC fails and that the function remains on the Submit display.
We did not find any entry on our knowledge base apart from the already mentioned DTAARA and the correct record length of 102 for QCBLLESRC.
Also, we had him interactively generate the function to see what happens and at which statement the generator stops.
He says that in this case, he gets completely kicked out of the model. Looking at the generated source in 2E by entering E against it, he sees no generated source, but when looking at it using PDM, he sees that it stopped at line 9999.
We had him do a CHGJOB to get a verbose joblog and are enclosing it in this issue.
From there we can see that the error is Run-unit ended at 70 in YGENSRCR1I We suspect that the customer hit a limit and will have to split the function.
We already told him the possibility of using Share subroutine and generate as subroutine options in case he uses many times the same internal function within his crashing function.
He will have a look at it.
Do you have any issues logged with this error ? 
IBM Iseries AS 400
I found a couple of similar cases.
The problem was resolved by splitting the large functions into smaller pieces.