Cover of The Art of Computer Programming by Donald E. Knuth - Business and Economics Book

From "The Art of Computer Programming"

Author: Donald E. Knuth
Publisher: Addison-Wesley Professional
Year: 2014
Category: Computers

🎧 Free Preview Complete

You've listened to your free 10-minute preview.
Sign up free to continue listening to the full summary.

🎧 Listen to Summary

Free 10-min Preview
0:00
Speed:
10:00 free remaining
Chapter 7: Multilinked Structures
Key Insight 1 from this chapter

Multilinked Structures and COBOL Data Representation

Key Insight

Multilinked structures, characterized by nodes containing multiple link fields, are crucial for representing complex structural information in higher-level applications, particularly in COBOL compilers. COBOL programs organize data hierarchically, as demonstrated by structures like SALES or PURCHASES, which contain sub-items such as DATE and TRANSACTION. These sub-items can further subdivide into elementary items like DAY and MONTH, with their relative order defining the sequence of quantities in external data representations.

To resolve potential naming ambiguities within these hierarchical structures, COBOL utilizes a qualification system. Programmers must qualify names, for instance, writing 'DAY OF SALES' to differentiate it from 'DAY OF PURCHASES'. Each name is preceded by an associated positive integer called its 'level number'. Items within a group must share the same level number, which must be greater than their parent group's level number; for example, DATE and TRANSACTION (level number 2) are part of SALES (level number 1).

A general qualified reference follows the form 'A0 OF A1 OF ... OF An', where A0 is an item directly or indirectly contained within Aj+1. Ambiguity necessitates complete qualification, meaning if a name like 'SHIPPER' is unique within the context, 'NAME OF SHIPPER' suffices. COBOL also supports the 'MOVE CORRESPONDING α TO β' statement, which acts as an abbreviation to move all items with matching names between the data areas α and β. For instance, 'MOVE CORRESPONDING DATE OF SALES TO DATE OF PURCHASES' moves MONTH, DAY, and YEAR values between the corresponding DATE structures.

📚 Continue Your Learning Journey — No Payment Required

Access the complete The Art of Computer Programming summary with audio narration, key takeaways, and actionable insights from Donald E. Knuth.