gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] To correct OpenCOBOL 1.1 Programmers Guide page 5-


From: john Culleton
Subject: Re: [open-cobol-list] To correct OpenCOBOL 1.1 Programmers Guide page 5-2 ?
Date: Wed, 7 Mar 2012 16:59:19 -0500

On Wed, 7 Mar 2012 21:16:43 +0100
Fred Mobach <address@hidden> wrote:

> On Wednesday 07 March 2012 20:10:04 vince wrote:
> >
> > On Wednesday 07 Mar 2012 14:11:50 Fred Mobach wrote:
> > > While reading time and again the OpenCOBOL 1.1 Programmers Guide
> > > paragraph 5.1. FD - File Description I question now if in the
> > > RECORD clause the entry [ FROM integer-5 [ TO integer-6 ]
> > > CHARACTERS is indeed optional. So I tested both options (according
> > > to diff :
> > > 25c25
> > >
> > > and the program without the FROM ... to  ... entry results in an
> > > error message at runtime:
> > > libcob: Record overflow (STATUS = 44) File : 'outfile'
> > >
> > > N.B. The same program without the entry FROM integer-5 [ TO
> > > integer-6 ]CHARACTERS results in the same runtime error message
> > > sited above.
> >
> > It is beginning to feel that the record you are reading in is larger
> > than the declared size according to the 01 record description which
> > is exactly what error 44 means.
> 
> Thank you, I'm afraid I'm fairly new to openCOBOL (not new to COBOL 
> however, since 1970).
> The sources / input file and a README are still available at 
> http://data.mobach.nl/opencobol/fdclause/with-or-without-fromto.tgz
> The records in the input file are 52 bytes (including the EOL) and in 
> the recordarea of the source they are specified as :
>        fd  outfile
>            record is varying in size
>            from 4 to 256 characters
>            depending on rec-length-out.
>        01  rec-out-record.
>            03  rec-out-byte            pic x(0001) occurs 256.
> Corresponding specifications without the  from 4 to 256 characters 
> results in the errors indicated. However, Gary informed me that the 
> presence of the OCCURS...DEPENDING ON can also result in this error.

I listed the program lenseqx.cob and don't understand one piece
of it. You read a record from infile into rec-out-record and later move
rec-in-record to rec-out-record. Isn't the move redundant? Read
into has the same effect as a read followed by a move.

-- 
John Culleton
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Police Procedural and Expose: "Death Wore Black"
"Create Book Covers with Scribus"
http://www.booklocker.com/books/4055.html


reply via email to

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