Chapter 9. Iteration: Beyond the Basic PERFORM
To familiarize you with
PERFORMstatements are used for iteration.
The various options available with the
THE SIMPLE PERFORM REVIEWED
The Basic Formats
In this section, we will review the simple PERFORM statement, which is used for executing a specified routine from one or more points in a program. This topic was introduced in Chapter 4 but will be discussed in more detail here. Later on in this chapter, we will review how other options of the
PERFORM are used for iteration or looping. There are two formats of the basic
1. PERFORM Paragraph-Name
The format for this version of the basic PERFORM is:
The PERFORM paragraph-name statement will:
Execute all instructions in the named paragraph.
Transfer control to the next instruction in sequence, after the
If you look at a reference manual you will find that this format for a
PERFORM uses the word "procedure-name" rather than paragraph-name. Because all paragraph-names are also procedure-names, we will use the terms interchangeably for now. In Chapter 14, we will consider procedure-names in more detail.
PERFORM paragraph-name statement is used whenever a series of instructions in a particular paragraph is to be executed from different points in the program. An example of this is ...