Thanks for that suggestion.  I tried moving SUB-PARA-2 in front of SUB-PARA-1, 
but the result was the same.

Tom Ross, if you're lurking and available, can you explain why I get this 
warning, or better what I can do to prevent it?

I was able to eliminate the message with the following change (hoisting the GO 
TO in SUB-PARA-1 back into PARA-1):

    MOVE PARM-DD TO WS-SUB.       
    PERFORM PARA-1 THRU PARA-EXIT.
    GO TO RETURN-TO-CALLER.       
                                  
PARA-1.                           
    IF PARM-MM > 06               
        MOVE +2 TO WS-SUB.        
    PERFORM SUB-PARA-2.           
    PERFORM SUB-PARA-1.           
    IF WS-SUB = 0                 
       GO TO PARA-EXIT            
    END-IF.                       
    MOVE WS-SUB TO RETURN-CODE.   
    GO TO PARA-EXIT.              
                                  
SUB-PARA-2.                       
    DISPLAY WS-SUB.               
                                  
SUB-PARA-1.                       
    IF WS-SUB < 6                 
       MOVE 0 TO WS-SUB           
    END-IF.                       
                                  
PARA-EXIT.                        
    EXIT.                         
                                  
RETURN-TO-CALLER.                 
    GOBACK.                       

In the real code from which this code structure is extracted and simplified, 
there are over 60 occurrences of PERFORM SUB-PARA-1, so it's going to be quite 
tedious to change them all in this manner.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of 
Bob Shannon
Sent: Monday, April 23, 2012 3:46 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: 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?

I haven't written in COBOL in over 30 years, but I suspect it's because 
SUB-PARA-2 sits in between SUB-PARA-1 and PARA-EXIT.

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.   

Bob Shannon
Rocket 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN

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

Reply via email to