gnucobol-users
[Top][All Lists]
Advanced

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

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


From: Fred Mobach
Subject: Re: [open-cobol-list] Recursive sequential file input?
Date: Mon, 5 Mar 2012 14:20:37 +0100
User-agent: KMail/1.9.10

On Monday 05 March 2012 05:03:35 Brian Tiffin wrote:
> On Fri, 02 Mar 2012 14:58:48 -0500, Fred Mobach <address@hidden> 
wrote:
> >
> > 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.

<<snip>>

> All that is needed is to put ws-namefound into LOCAL-STORAGE SECTION.
>
> One line fix to
>
>       01  ws-switches.
>           03  sw-eof-input            pic x(0001)  value low-values.
>              88   eof-input                        value high-value.
>       local-storage section.
>        01  ws-namefound                pic x(0128).
>        linkage section.
>        01  actual-cmdlinearg1          pic x(0128)  value spaces.

Thank you very much for this hint, it works as you described. But how 
must I read in the OpenCOBOL 1.1 Programmers Guide page 5-1 the text at 
point 4: LOCAL-STORAGE cannot be used in nested programs.

> so there are still issues with the code flow, but not disappearing
> working-storage problems.

Great. When a new OpenCobol release is published I'll test it again.
-- 
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]