View previous topic :: View next topic
|
Author |
Message |
muthukumar
New User
Joined: 24 Mar 2004 Posts: 29
|
|
|
|
I tried writing a recursive program with VS-COBOL II. I got the following error during run time.
IGZ0015S A recursive call was attempted to a program that was already active.
Does this mean VS-COBOL II does not support recursive functionality or else some problem with the functionality of my code.
find the code below
IDENTIFICATION DIVISION.
PROGRAM-ID. COBOL1.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WORK-NUM PIC 9(02) VALUE 1.
01 INCREM PIC 9(01) VALUE 5.
PROCEDURE DIVISION.
COMPUTE WORK-NUM = WORK-NUM * INCREM.
COMPUTE INCREM = INCREM - 1
CALL 'COBOL1'.
IF INCREM = 0
DISPLAY ' FACTORIAL ' WORK-NUM
GOBACK.
regards
Muthu |
|
Back to top |
|
|
mdtendulkar
Active User
Joined: 29 Jul 2003 Posts: 237 Location: USA
|
|
|
|
Hello muthukumar,
Take a look at the following link for more details and example on recursive programming.
Code: |
http://www.naspa.com/PDF/99/T9906004.pdf |
Hope this helps
Regards
Mayuresh Tendulkar |
|
Back to top |
|
|
|