Skip to Content
Modern Mainframe Development
book

Modern Mainframe Development

by Tom Taulli
March 2022
Intermediate to advanced
348 pages
8h 37m
English
O'Reilly Media, Inc.
Book available
Content preview from Modern Mainframe Development

Chapter 5. File Handling

A typical modern computer language may not use files often. A programming book or manual may not even cover this topic. This makes sense, as many applications do not necessarily handle data processing.

But the situation is different with the mainframe. File handling is an essential part of the process. This goes back to the early days, when businesses wanted to find ways to replace the tedious approaches of using ledgers and 3 x 5-inch cards. The mainframe and COBOL were seen as a way to automate the back office.

To this end, various types of files are available. They include sequential, indexed, and relative. In this chapter, we’ll take a look at the first two and show how the COBOL language can use them. Relative files are not used much and therefore are not covered in this book.

Records and Files

A file for a mainframe is usually composed of a set of records, which is a group of related fields. An example of a record is a customer master file, which has fields for first name, last name, address, credit limit, and so on.

A mainframe initially reads the records into the real or central storage; this is similar to random access memory (RAM) for PCs. Even though the capacity is high, a file can easily exceed the storage limit. This is why a mainframe reads one or a small group of records at a time, so as not to overwhelm the real memory.

Typically, a record is fixed-length, each having the same number of characters. But in some cases, a dataset has variable-length ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Modern Linux

Learning Modern Linux

Michael Hausenblas
Programming Rust, 2nd Edition

Programming Rust, 2nd Edition

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall

Publisher Resources

ISBN: 9781098107017Errata PageSupplemental Content