Chapter 5. Designing and Debugging Batch and Interactive COBOL Programs

OBJECTIVES

To familiarize you with

  1. The way structured programs should be designed.

  2. Pseudocode and flowcharts as planning tools used to map out the logic in a structured program.

  3. Hierarchy or structure charts as planning tools used to illustrate the relationships among modules in a top-down program.

  4. The logical control structures of sequence, selection, iteration, and case.

  5. Techniques used to make programs easier to code, debug, maintain, and modify.

  6. Interactive processing.

WHAT MAKES A WELL-DESIGNED PROGRAM?

Many programming texts teach the instruction formats and coding rules necessary for writing programs without ever fully explaining the way programs should be designed. In fact, in Chapters 1 through 4 we illustrated the actual planning tools used to specify the logic in a program. In this chapter, we focus on the full range of program design tools that can be used in all programs.

We use the term program design to mean the development of a program so that its elements fit together logically and in an integrated way. In Chapters 1 through 4, we discussed several program design techniques.

Program Logic Should Be Mapped Out Using a Planning Tool

If programs are systematically planned before they are coded, they will be better designed. Planning tools such as pseudocode and hierarchy charts help programmers map out program logic. Just as architects prepare blueprints before buildings are constructed, so, too, should programmers ...

Get COBOL for the 21st Century now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.