O'Reilly logo

Rexx Programmer's Reference by Howard Fosdick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Input and Output

Overview

Input/output, or I/O, is how a program interacts with its environment. Input may come from what a user types in, an input file, or another program. Program output might be written to the display, to an output file, or to a communication mechanism such as a pipe. These are just a few of the possibilities.

Rexx provides a simple-to-use, high-level I/O interface. At the same time, Rexx aims for standardization and portability across platforms. Unfortunately, this latter goal is difficult to achieve—I/O is inherently platform-dependent, because it relies upon the file systems and drivers the operating system provides for data management. These vary by operating system.

This chapter describes the Rexx I/O model at a conceptual level. Then it explores examples and how to code I/O. The last part of the chapter discusses some of the problems that any programming language confronts when trying to standardize I/O across platforms, some of the trade-offs involved, and how this tension has been resolved in Rexx and its many implementations.

Rexx provides an I/O model that is easy to use and as portable as possible. Section II explores the I/O extensions that many versions of Rexx offer for more sophisticated (but less portable) I/O. Chapter 15 illustrates database I/O and how to interface scripts to popular database management systems such as SQL Server, Oracle, DB2, and MySQL.

The Conceptual I/O Model

Rexx views both input and output as streams—a sequence of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required