|
Consider the following factors when you process records in UNIX
files:
- Block boundaries are not maintained within the file. If you write
a short block other than at the end of the file, a later read at that
point returns a full block (except for RECFM=VB, which always returns
a single record).
- Record boundaries are not maintained within binary
files except with fixed-length records, but
the access method maintains record boundaries when FILEDATA=TEXT or
FILEDATA=RECORD is in effect..
- Text files are presumed to be EBCDIC.
- Repositioning functions (such as POINT, BSP, CLOSE TYPE=T) is
not permitted for FIFO or character special files.
- The default record format (DCBRECFM) is U for input and output.
- The default block size (DCBBLKSI) on input is 80. There is no
default for output.
- The default LRECL (DCBLRECL) on input is 80. There is no default
for output.
- When RECFM=F(B(S))
- And
the file accessed has a FILEDATA type
of binary, if the last record in the file
is smaller than LRECL bytes, it is padded with zeros when it is read.
- And the file accessed
has a FILEDATA type of text, if any record
in the file is smaller than LRECL bytes, it is padded with blanks
when it is read. If any record is longer than LRECL bytes, it results
in an I/O error due to incorrect length when it is read.
- And the file accessed has a FILEDATA type of record, if any record in the file is smaller
or larger than LRECL bytes, it results in an I/O error due to incorrect
length when it is read.
- When RECFM=V(B)
- And the file accessed has a FILEDATA
type of binary, each record is returned as
length LRECL, except, possibly, for the last one.
- And the file accessed has a FILEDATA
type of text, if any record in the file consists
of zero bytes (that is, a text delimiter is followed by another text
delimiter), the returned record consists of an RDW and no data bytes.
If any record is longer than LRECL bytes, it results in an I/O error
due to incorrect length when it is read.
- And the file accessed has a FILEDATA type of record,
if any record in the file consists of zero bytes (that is, a record
prefix (IGGRPFX) contains a zero length), the returned record
consists of an RDW with no data bytes. If any record is longer than
LRECL bytes, it results in an I/O error due to incorrect length when
it is read.
- When RECFM=U
- And the file accessed has a FILEDATA
type of binary, each record is returned with
a length equal to block size, except, possibly, for the last one.
- And the fileaccessed has a FILEDATA
type of text , if any record in the file consists
of zero bytes (that is, a text delimiter is followed by another text
delimiter), the returned record consists of one blank. If any record
is longer than the block size, it results in an I/O error due to incorrect
length when it is read.
- And the file accessed has a FILEDATA type of record,
if any record in the file consists of zero bytes (that is, a record
prefix (IGGRPFX) contains a zero length) or any record is longer than
BLKSIZE bytes, it results in an I/O error due to incorrect length
when it is read.
|