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

RE: gnubol: Record delimiter clause and parse order



COBOL implementations frequently implement sequential IO in a variety of
ways.

For example, on IBM Mainframes, "record length" is a fundamental component
of the file specification carried within the file system. Asking the file
system for the next record will get you the next record without you needing
to specify length.

On PCs, there is no file system specification of record length. Rather a
record is an arbitrary cluster of sequential bytes contained within the long
concatenated string of bytes we call a file.

Within COBOL designed to operate in the PC environment, there are a couple
of issues.

Consider "fixed length" files first: I'll define the file with 80 byte
records.

When I do a sequential read, what happens?

Option one: give me the next 80 bytes.

Option two: give me bytes until you hit a delimiter, then "fill" the
remainder of the record.

Now consider a "variable length" file. I use the "record length varying . .
. depending on" clause to identify a Working Storage variable to contain the
record length. On a read, this variable should be set by the file system,
after the read, to contain the length of the record actually read.

On a PC this can be accomplished in two ways:

(1) use of a delimiter,

(2) use of record length counts (similar to the IBM mainframe imlementation
of variable length  records)

If all of this confuses more than it helps, my apologies.

James S. Huggins











--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.