× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.





 >> A gotcha of COBOL is that when the Rn Unit (program) ends

Admittedly the effect is the same in this case but a COBOL Run Unit does not
equate to a program.  The run unit starts with the first COBOL program in the
invocation (known as Main) and encompasses all subsequent COBOL programs _and_
anything else including RPG that is called between.

 >> since the source code was not available, we could not change how the
program's run Unit ended

Having the source would not have made any difference, unless the code was ILE
COBOL when the "Preserve Run Unit" option is available on some releases. The
only cure was to do what you did.  In the initial scenario there was only one
COBOL program in the stack and therefore it was the Main program in the run
unit.  COBOL rules say that when the Main program returns to its caller - no
matter what mechanism is used - that the run unit terminates. Not only does the
COBOL program behave as an RPG program exiting with LR would behave, but it also
goes to the expense of building and tearing down the run unit controls every
time it is called.  By placing a COBOL program earlier in the invocation you
ensured that the run unit was preserved between calls.  Come to think of it, the
fact that your fix worked proves conclusively that having the source code would
have done you no good at all.


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.