On 23 Apr 2012 12:36:08 -0700, in bit.listserv.ibm-main (Message-ID:<985915eee6984740ae93f8495c624c6c21e1d43...@jscpcwexmaa1.bsg.ad.adp.com>) [email protected] (Farley, Peter x23353) wrote:

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.

It's been a *long* time since I coded Cobol, but I suspect the compiler is right.

SUB-PARA-1 is part of the PERFORM in line 33. Thus, as far as the compiler can tell, you're performing yourself from within the perform, which could easily lead to an endless recursion.

Try moving both SUB-PARAs out of PARA-1 and give each their own EXIT. If you want that extra execution of -2, code it as another PERFORM.

--
I cannot receive mail at the address this was sent from.
To reply directly, send to ar23hur "at" pobox "dot" com

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

Reply via email to