Re: Write position
- From: GaryScott <garylscott@xxxxxxxxxxxxx>
- Date: Mon, 9 Feb 2009 12:22:10 -0800 (PST)
On Feb 9, 2:10 pm, Glen Herrmannsfeldt <g...@xxxxxxxxxxxxxxxx> wrote:
Dave Allured wrote:
(snip)
How are plain text files (sequential formatted) stored on the 360
family? Is it easy to know or enquire the length of a physical disk
block?
The formats used by OS/360 are still used by the current z/OS.
There are a few different file formats used, denoted by the RECFM
keyword on the DCB parameter.
F Fixed length unblocked. All records are the same length, known
when the data set is created. The record length is known as LRECL.
Used for Fortran direct access files.
FB Fixed length records combined into a larger block, where the block
size (BLKSIZE) is an integer multiple of LRECL. Larger blocks
increase the efficiency of I/O. (LRECL=80 is very popular..
LRECL=133 is often used for printed output.)
For OS/360, only F and FB were supported by Fortran formatted I/O.
V Variable length unblocked, each record and block has a four byte
header containing a two byte length. One record per block.
VB Variable length blocked. More than one record per block, again
each record and block has a four byte header.
VBS Variable blocked spanned. As above, but records can be longer
than blocks, with header bits indicating the first block, subsequent
blocks, and last block of a record. This is used for Fortran
UNFORMATTED data, and likely was created for that.
U Undefined. The system keeps track of blocks, the user keeps
track of the contents of the blocks.
For F, FB, V, and VB an A or M can be appended indicating that the
data set uses ASA or Machine carriage control, respectively, in
the first character on each record.
In writing an FB file, it is usual that all the blocks except the last
will be the same length. If you append (DISP=MOD on the DD statement)
to an existing data set the last block is not rewritten but new blocks
are appended. In that case, a short block exists other than at the end..
RECFM=FBS indicates that the data set does not contain short blocks
other than at the end. FBS is rarely used.
The system keeps track of the number of tracks, and I believe blocks,
in a file but not the number of bytes. For C's fseek()/ftell(), and
any RECFM other than FBS, it is not easy to find the number of bytes,
so the IBM C library returns something like 32768*record+offset.
For FBS I believe it returns the correct byte offset.
http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/co....
> Given this information, would it not be simple to write a
> system-dependent program that would re-write the first few characters of
> a very large text file, without changing the rest of the file?
Not so hard in assembler, but Fortran doesn't supply this ability.
VM supports those (or nearly all) plus a unix-y file system. I don't
know if it is emulated and has one of the above structures under the
hood.
-- glen
.
- References:
- Write position
- From: Bokgae
- Re: Write position
- From: glen herrmannsfeldt
- Re: Write position
- From: Arjen Markus
- Re: Write position
- From: Bokgae
- Re: Write position
- From: Clive Page
- Re: Write position
- From: Dave Allured
- Re: Write position
- From: Richard Maine
- Re: Write position
- From: Dave Allured
- Re: Write position
- From: Glen Herrmannsfeldt
- Re: Write position
- From: Dave Allured
- Re: Write position
- From: Glen Herrmannsfeldt
- Write position
- Prev by Date: Re: STOP in Fortran 2003
- Next by Date: Re: Fortran 77: read second number on a line in a comma delimited text file
- Previous by thread: Re: Write position
- Next by thread: Re: Write position
- Index(es):
Relevant Pages
|