|
Thanks, Karen. Although the CONTINUE RUN UNIT phrase is apparently only valid in ILE Cobol, I understand what you're saying. I'm going to redesign things so that the initial Cobol "stub" program in the run unit CALLs the process, which includes the Cobol program responsible for creating the report. I'll use GOBACK instead of STOP RUN in order to ensure that the printer file isn't closed. I would have liked to avoid putting the report program at a higher call level and using a stub program. Perhaps someday we'll start using ILE. Thanks to all of you for your responses! I've learned much from this discussion. - Greg Phillips -----Original Message----- From: cobol400-l-bounces@xxxxxxxxxxxx [mailto:cobol400-l-bounces@xxxxxxxxxxxx]On Behalf Of Karen L Hodge/MIS/Genesys Sent: Monday, March 21, 2005 6:35 AM To: COBOL Programming on the iSeries/AS400 Subject: RE: [COBOL400-L] Multiple Reports in One Spooled File Here are the rules: An EXIT PROGRAM statements does not change the status of any of the files in a run unit (in other words, file would stay open) unless: - The program issuing the EXIT PROGRAM has the INITIAL attribute. If it does, then all files are closed. - An EXIT PROGRAM statement with the AND CONTINUE RUN UNIT phrase is issued in the main program of a *NEW activation group. In this case, control returns from the main program to the caller, which, in turn, causes the *NEW activation group to end, closing all of the files scoped to the activation group. A STOP RUN statement returns control to the caller. ALL files will be closed. A GOBACK issued from the main program behaves the same as the STOP RUN. A GOBACK issued from a subprogram behaves the same as the EXIT PROGRAM statement. So, use just the EXIT PROGRAM with no STOP RUN or GOBACK. Thank you, Karen Hodge Senior System Analyst Genesys Health System 1000 Healthpark Blvd, Grand Blanc, Mi 48439 Office 810.606.5180, Fax 810.606.7204 khodge@xxxxxxxxxxx
As an Amazon Associate we earn from qualifying purchases.
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.