× 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.



I am experiencing a problem with the COBOL run unit on a V4R5 system.  I
would be grateful if you folks can check it out on other releases and
confirm if this is an on-going bug or a temporary aberration.

Since the programs are short I have embedded the source here in the note.
Name of the program is in each program.  Compile both programs to run in a
named AG.

Here's the call sequence:

CALL AG1A, when it returns call it again.  The counts will show that the run
unit was preserved as expected.

Next call AG1B. The EXIT PROGRAM is honored as it should be since this is
not the first COBOL program in the AG.  You can also do a DSPJOB and see
that the AG is still there.

Now call AG1B again - the count clearly shows that the AG is intact from the
last call.  However - on my system this time it ignores the Exit Program and
does a stop run when it hits the end of the program.

Clearly it can't be a sub-program on the first call and the main on the
second so something is wrong here.

Here's the code.

*************** Beginning of AG1A ********************
       Identification Division.
       Program-Id.  AG1A.

       Data Division.

       Working-Storage Section.
       77 testCount Pic s9(3) Value 0.

       Procedure Division.
       MainlineControl.
           Add 1 to testCount.
           Display "AG1A Count = " testCount.

           Exit Program and continue run unit.

*************** Beginning of AG1B ********************
       Identification Division.
       Program-Id.  AG1B.

       Data Division.

       Working-Storage Section.
       77 testCount Pic s9(3) Value 0.

       Procedure Division.
       MainlineControl.
           Add 1 to testCount.
           Display "AG1B Count = " testCount.

           Exit Program.

           Display "AG1B Fall through Exit program".

Jon Paris
Partner400




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.