gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Recursive sequential file input?


From: Fred Mobach
Subject: [open-cobol-list] Recursive sequential file input?
Date: Fri, 2 Mar 2012 20:58:48 +0100
User-agent: KMail/1.9.10

Hello,

Some information about recursive programming in COBOL found on the web. 
That encouraged me to test if it will also work on file input [1]. So I 
wrote a small program / subroutine with some testfiles in one directory 
(121 lines of code) which are available at 
http://data.mobach.nl/opencobol/recursivetest/recursiveprog.tgz 

The test program needs argument1 (= filename for input), calls a 
subroutine with that name in its argument. The subroutine tries to read 
that primary file, shows with display messages how it proceeds and 
tries to recursively call itself with filenames found the primary file.

Console output example:
address@hidden:~/cob-idx/testrecurive> ./recursiveprog testrecursiv1
File to process: testrecursiv1
Sub: to process  testrecursiv1
text: #empty
text: testrecursiv2
Next file to process: testrecursiv2
Sub: to process
recursiveprog.cob:94: libcob: File does not exist (STATUS = 35) 
File : 'infile'

Environment:
OpenCobol : cobc (OpenCOBOL) 1.1.0
OS        : GNU/Linux (opensuse 12.1 ) with kernel version 3.1.0-1.2

Question: is one of the INITIAL/COMMON options in the PROGRAM-ID needed 
at top of the recursive option there or is it inpossible to reuse the 
memory needed for an input file?

[1] This test is intended to check if it's possible in OpenCobol to read 
a source program with nested COPY statements.
-- 
Fred Mobach
website : https://fred.mobach.nl
 .... In God we trust ....
 .. The rest we monitor ..


reply via email to

[Prev in Thread] Current Thread [Next in Thread]