Skip to Main Content
PROGRAMMING IN COBOL/400: 2nd Edition
book

PROGRAMMING IN COBOL/400: 2nd Edition

by James Cooper, Nancy Stern, Robert A. Stern
January 2002
Intermediate to advanced content levelIntermediate to advanced
736 pages
18h 57m
English
Wiley
Content preview from PROGRAMMING IN COBOL/400: 2nd Edition

Chapter 16. MULTIPLE-LEVEL ARRAYS AND TABLES

CHAPTER OBJECTIVES

Upon completion of this chapter, you should be able to

  • Establish a series of items using a double-level OCCURS clause.

  • Demonstrate how to establish a series of items within a multiple-level array.

  • Demonstrate how to look up data stored in a multiple-level array.

  • Access and manipulate data defined with a triple-level (or more) OCCURS clause.

DOUBLE-LEVEL OCCURS CLAUSE

When describing an area of storage, as many as seven levels of OCCURS are permitted.

Like a single-level OCCURS, multiple levels of OCCURS may be used for (1) accumulating totals in an array, or (2) storing a table for "look-up" purposes. We will look first at multiple-level arrays and then at multiple-level tables.

DEFINING A DOUBLE-LEVEL, OR TWO-DIMENSIONAL, ARRAY

Suppose we wish to establish in storage an array of hourly temperature readings for Los Angeles or any other city during a given week. Once the array is established, it is used to perform various calculations. The array consists of 7 × 24 temperature readings; that is, there are 24 hourly temperature readings for each of 7 days. The array is represented as

DEFINING A DOUBLE-LEVEL, OR TWO-DIMENSIONAL, ARRAY

To define this array in WORKING-STORAGE with a single-level OCCURS would require the following coding.

DEFINING A DOUBLE-LEVEL, OR TWO-DIMENSIONAL, ARRAY

The ellipses, or dots (. . .), indicate that 24 elementary ...

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

Designing and Programming CICS Applications

Designing and Programming CICS Applications

John Horswill, Members of the CICS Development Team at IBM Hursley

Publisher Resources

ISBN: 9780471418467Purchase book