gnucobol-users
[Top][All Lists]
Advanced

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

Re: Re: [open-cobol-list] variable record size sequential files


From: David Korn
Subject: Re: Re: [open-cobol-list] variable record size sequential files
Date: Tue May 25 10:54:04 2004

cc:  address@hidden
Subject: Re: Re: [open-cobol-list] variable record size sequential files
--------

Variable record sized files on MVS (VB or VBM), show up with each
record proceded by 4 bytes 
        x y 0 0
(x<<8)|y)  is the size of the record including the 4 byte header.

I modified the fileio.c by changing
        if (fread (&f->record->size, sizeof (f->record->size), 1, f->file) == 
0)to
        if((f->record->size=fsize_read(f->file)) == 0)
in sequential_read(), and
        fwrite (&f->record->size, sizeof (f->record->size), 1, f->file);
to
        fsize_write(f->file,f->record->size);
in sequential_write()

and then writing functions fsize_read() and fsize_write() to handle
the byte swapping and to 4 byte size difference between the data
size and the record size.

This seems to be working fine.

David Korn
address@hidden


reply via email to

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