Performing a paragraph does not require an "exit" point, one is generated automatically. Same holds true if you perform a SECTION. However, your perform is branching to an EXIT statement which, in effect, is trying to "short-circuit" the PARA-1 when ws-sub is less than 6.
I would suggest taking out the GO TO in PARA-1 and simply let the IF move 0 to ws-sub while ws-sub is less than 6. Because your perform if para-1 is a perform and not a perform ... thru ...., an exit point will be generated for para-1 just prior to para-2. Using a branch to an EXIT statement is a common way of perform para-a thru para-b and para-b is an EXIT statement. Then, anywhere in the code that falls between para-a and para-b, you can branch to para-b and "get out" of the current perform, return to the point of the perform and then, the generated logic will determine if it need to "go again" or not. Performing a paragraph which has the SECTION clause on it provides a similar construct (thought not the exact same) as a perform para-a thru para-b. When one codes in sections it is not uncommon to find the last paragraph in the section is a paragraph with nothing more than an EXIT statement. Hope this helps. Chuck Charles (Chuck) Hardee Senior Systems Engineer Database Administration Information Technology Services Thermo Fisher Scientific chuck.har...@thermofisher.com -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Farley, Peter x23353 Sent: Monday, April 23, 2012 3:33 PM To: IBM-MAIN@bama.ua.edu Subject: Why does Enterprise COBOL V4.1 optimization complain about a PERFORM loop? Can anyone explain to me why I get Enterprise COBOL V4.1 "informational" message IGYOP3094-W in the do-nothing program listed below? TIA for curing my ignorance. Peter PP 5655-S71 IBM Enterprise COBOL for z/OS 4.1.0 TESTGOTO Date 04/23/2012 Time 15 LineID PL SL ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+----7-|--+----8 000001 * PROPRIETARY COMMENT ON LINE 1 REMOVED FOR PRIVACY 000002 ID DIVISION. 000003 PROGRAM-ID. TESTGOTO. 000004 ENVIRONMENT DIVISION. 000005 DATA DIVISION. 000006 WORKING-STORAGE SECTION. 000007 01 WS-WORK-AREA. 000008 05 WS-SUB PIC S9(4) USAGE IS BINARY. 000009 000010 LINKAGE SECTION. 000011 01 PARM-AREA. 000012 05 PARM-LEN PIC S9(4) BINARY. 000013 05 PARM-DATA. 000014 10 PARM-CC PIC 9(02). 000015 10 PARM-YY PIC 9(02). 000016 10 PARM-MM PIC 9(02). 000017 10 PARM-DD PIC 9(02). 000018 PP 5655-S71 IBM Enterprise COBOL for z/OS 4.1.0 TESTGOTO Date 04/23/2012 Time 15 LineID PL SL ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+----7-|--+----8 000020 PROCEDURE DIVISION USING PARM-AREA. 000021 * LINES 22-30 PROPRIETARY COPY CODE REMOVED FOR PRIVACY 000031 000032 MOVE PARM-DD TO WS-SUB. 000033 PERFORM PARA-1 THRU PARA-EXIT. 000034 GO TO RETURN-TO-CALLER. 000035 000036 PARA-1. 000037 IF PARM-MM > 06 000038 1 MOVE +2 TO WS-SUB. 000039 PERFORM SUB-PARA-2. 000040 PERFORM SUB-PARA-1. ==000040==> IGYOP3094-W There may be a loop from the "PERFORM" statement at "PERFORM (line 40.01)" to itself. "PERFORM" statement optimization was not attempted. 000041 MOVE WS-SUB TO RETURN-CODE. 000042 GO TO PARA-EXIT. 000043 000044 SUB-PARA-1. 000045 IF WS-SUB < 6 000046 1 MOVE 0 TO WS-SUB 000047 1 GO TO PARA-EXIT. 000048 000049 SUB-PARA-2. 000050 DISPLAY WS-SUB. 000051 000052 PARA-EXIT. 000053 EXIT. 000054 000055 RETURN-TO-CALLER. 000056 GOBACK. 000057 This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN