Skip to main content
Module 7 · Lesson 2 of 214/16 in the course~16 min
Module lessons (2/2)

Copybook (COPY), REDEFINES and Level 88 Condition Names

Lesson preview5 hands-on exercises readyCourse COBOL · Module 7 — File Sorting, Copybook and Level 88

Share records between dozens of sources with COPY REPLACING, overlay layouts on the same RAM via REDEFINES, and model states with Level 88 and SET TO TRUE.

What you'll learn in this lesson

  • Include paths shared between multiple programs using COPY and parameterize their prefixes with REPLACING.
  • Replace comparisons on magic codes with 88 (Condition Names) and update their status with SET <nome> TO TRUE.
  • Reinterpret the same bytes in memory with multiple structural views using REDEFINES.

Overview

Writing maintainable COBOL code means separating the shared data structure (Copybook) from the program logic and making business conditions self-explanatory.

A Copybook is an external file (typically a mainframe PDS library) containing record definitions, which the preprocessor inserts at compile time via COPY:

Sections covered in this lesson

  1. 11. Reusing paths with COPY and REPLACING
  2. 22. Condition-name at level 88 and verb SET
  3. 33. Multiple views on the same bytes with REDEFINES
  4. 4Try it yourself
Pro Lesson · Module 7 — File Sorting, Copybook and Level 88

Unlock "Copybook (COPY), REDEFINES and Level 88 Condition Names" and the full Course COBOL curriculum

Share records between dozens of sources with COPY REPLACING, overlay layouts on the same RAM via REDEFINES, and model states with Level 88 and SET TO TRUE.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Course COBOL plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.