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

Re: gnubol: Record delimiter clause and parse order



See below 

Matthew Vanecek wrote:

> The problem I have is that if you ftp to the mainframe, say from your
> Linux box, and download a sequential file, when you open that sequential
> file, it's going to be delimited by \n.  If you do the same from
> Windows, it'll have "\r\n".  This caused no end of grief for me, when I
> still used both OS's, until I had to start ftp-ing between my windows
> and Linux box, too. :(  Samba for some reason just didn't do the
> translation properly at the time.

Thus the cobd2u and cobu2d utilities. 

> ... I'll have to dig up my IBM docs somehow, and see if they put in a
> description of the physical file format. ...
> Stuffs for the future. :)...
> Matthew Vanecek

The files on MVS (forgetting about VSAM for the time being, which
is a whole other setup) have a physical layout and a logical
layout. The files also have attributes in the file system.

The physical block layout is on the hard disk. Yes the hard disks
have variable length blocks. So if you say BLKSIZE=20000, you
will get blocks of 20,000 bytes (or less for the last short
block). None of this nonsense exists in Unix, everything is fixed
block length.

Then there is the record layout. Fixed length records (RECFM=FB)
just have the records places one after another in the blocks,
with no delimiter and no record prefix. Variable length records
have a record prefix of 2 bytes big endian. I think this limits
the record size to 32k.

When you download to PC/Unix it maps this into delimited records
or not depending on the options you select in Extra or whatever.

I agree there is no need to support tapes, just need to make sure
we parse all the clauses and tell them they are ignored (if in
pedantic mode).

--
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.