Thanks for the response.  We are saying the same thing about the GOBACK

Thanks for the warning about recursion.  I researched it a bit and found
that ILE Cobol won't allow it (although ILE C does), and that the results
under OPM Cobol are unpredictable.  I'll go with the Cobol stub program

- Greg Phillips

-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx]On Behalf Of Jon Paris
Sent: Sunday, March 20, 2005 9:41 PM
To: COBOL Programming on the iSeries/AS400
Subject: RE: [COBOL400-L] Multiple Reports in One Spooled File

 >> I think GOBACK is equivalent to EXIT PROGRAM, followed by STOP RUN, so
I'm not surprised.

Not quite.  GOBACK means "Do a Stop Run if you are leaving the root program,
otherwise do an Exit Program.  It was added to the language to avoid code
like this:

   Exit Program.
* If Exit Program "dropped through" issue Stop Run
   Stop Run.

Recursion in this case is frankly a waste of effort - this is not a
recursive process.  Besides, recursion doesn't really work properly in OPM

Simply prevent the run unit from terminating with one of the methods I
mentioned earlier and everything will work as you want.

Jon Paris

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-2022 by 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.