Menu

IBM Mainframe (ZOS) File Structures

Bruce Martin

IBM Mainframe (ZOS) File System

The ZOS File is completely different from the Unix/Linux/Windows file systems.
For the type of processing done on the Mainframe, it is a lot more efficient.

  • On *nix/Window a file is a file and it up-to the program to decide how to interpret then file.
    These operating systems are text and char/byte orientated.
  • Zos is record (and binary file) orientated, the operating system knows how files are organized.

Why Do it this way

PERFORMANCE - The operating system is optermized for Cobol Batch record orientated
processing. Two obvious advantages

  • no conversion of numbers to / from binary.
  • When a text file, you have to tested every byte to see if it is the \n character.
    So to do record orientated on a say 1gb text file the is a 4 billion instruction overhead.
    With the mainframe (assuming 100 byte records) it would be 30 million.

These days this is minor but 50 years ago it was significant.

VB/FB files

While there are many other file types than VB/FB on the mainframe, they

  • The two most common types of Data files (by a large margin).
  • It is easy copy other file types to either vb/fb
  • They are easy to implement.

Fixed Block (FB) file

In Fixed Block records, all records have exactly the same size

FB File (constant recordlength records, no eol marker) This is Constants.IO_FIXED_LENGTH_RECORDS:

 (Record  1 --------------------)
 (Record  2 --------------------)
 (Record  3 --------------------)
 (Record  4 --------------------)

ogically a VB File (length at the start of the record) This is Constants.IO_VB:

 (Record Length)(Record  1 ----------------------------)
 (Record Length)(Record  2 ----------)
 (Record Length)(Record  3 ----------------------)
 (Record Length)(Record  4 ---------------)

Physically on a disk a VB file is devided up into blocks so you actually have (Constants.VB_DUMP):

(bdw)(rdw)[record](rdw)[record   ](rdw)[record ](rdw)[record   ](rdw)[record]
(bdw)(rdw)[record](rdw)[record  ](rdw)[record](rdw)[record    ](rdw)[record    ]
(bdw)(rdw)[record](rdw)[record    ](rdw)[record ](rdw)[record ](rdw)[record]

Where

  • bdw - Block Descriptor word (block length)
  • redw - Record Descriptor word (record length)

It will depend how you tranmit a VB file wether you get it as
Constants.VB, Constants.VB_DUMP or