COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-16
ALTER
Correspondence depends on the names of the elementary items, not on the physical
order of the elementary items. In Example 9-5, all data item names correspond except
STAPLES and PAPER. Add operations skip STAPLES and PAPER.
ALTER
ALTER changes the destination of a GO TO statement, which can cause maintenance
problems.
paragraph-name
is the name of a paragraph that contains only an unconditional GO TO statement.
Example 9-5. ADD CORRESPONDING Statement
WORKING-STORAGE SECTION.
01 CABINET-SUPPLIES.
05 PAPER-CLIPS PIC 99.
05 WRITING-TOOLS.
10 PENCILS PIC 99.
10 PENS PIC 99.
10 ERASERS PIC 99.
10 PAPER PIC 99.
05 STAPLES PIC 99.
01 STOCKROOM-SUPPLIES.
05 WRITING-TOOLS.
10 PENCILS PIC 99.
10 ERASERS PIC 99.
10 PENS PIC 99.
05 PAPER-CLIPS PIC 99.
05 PAPER PIC 99.
...
PROCEDURE DIVISION.
...
ADD CORRESPONDING CABINET-SUPPLIES TO STOCKROOM-SUPPLIES.
Note. The 1985 COBOL standard classifies ALTER as obsolete, so you are advised not to
use it. Instead, use a flag, a conditional GO TO statement, and a MOVE statement.
ALTER paragraph-name TO
PROCEED TO
destination
VST131.vsd