Jon, Thanks for the response. We are saying the same thing about the GOBACK statement. 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 approach. - 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 anyway. 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.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.