Re: Write position



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

.



Relevant Pages

  • Re: Bitmpa.Save & GZipStream - error
    ...   class Program ...     static void Main ... For all other formats it fails. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Date comes out wrong in England
    ... Access MVP 2002-2005, 2007-2008 ...     International Date Formats in Access ... I think that the reports come out wrong by putting information in the ...
    (microsoft.public.access.reports)
  • Re: decimal to binary?
    ...   BM> The sprintffamily is your friend. ... that will only generate text (hex and other formats). ... Why is sprintf not a reasonable ...
    (perl.beginners)
  • Re: K-Lite Mega Codec Pack 6.70
    ... encoding and decoding audio and video formats. ... With the K-Lite Codec Pack you should be able to play all the popular ... audio and video formats and even several less common formats. ...     * All components have been carefully selected for specific ...
    (rec.games.pinball)
  • Re: Custom formats
    ... Cell styles in a workbook     4,000 ... A few years back, in a test, I could get almost 300 custom number formats into Excel. ...
    (microsoft.public.excel.misc)