On 23 Apr 2012 12:36:08 -0700, in bit.listserv.ibm-main you wrote:

>Can anyone explain to me why I get Enterprise COBOL V4.1 "informational" 
>message IGYOP3094-W in the do-nothing program listed below?

It is bad COBOL because there is a GO TO PARA-EXIT in SUB-PARA-1 which
in this case means that if WS-SUB is less than 6 "MOVE WS-SUB TO
RETURN-CODE is not done.  If there is a separate EXIT paragraph it
should only be reached from the paragraph associated with it in the
PERFORM, in this case PARA-1.  For the best optimization eliminate all
PERFORM ... THRU statements and I have gone the route of having GOBACK
/ STOP RUN only in the main line first paragraph and no GO TO
statements in the program.  Technically there can not be a loop but
given the way PERFORM is implemented in some cases the results might
not be what you would expect if SUB=PARA-1 were reached by something
other than a PERFORM.

Clark Morris
>
>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 [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to