Only use a GO statement to branch to a point within the same subroutine. Never use a GO statement to branch from a subroutine to a point in the mainline code. Although this can be accomplished using COBOL, it should be regarded as being contrary to the basic tenets of structured programming.
Avoid nesting structured programming operations too deeply. For example, more than three or four levels of nesting in a given section level. If more are needed, use another section.
Programs should be as structured as possible. A program is not ‘structured’ just because it only uses structured operation codes. A structured program is one that is modularized in an efficient way and built up out of the structured programming constructs—SEQUENCE, CONDITION (CASE) or ITERATION, and structured combinations thereof. The constructs might even be implemented logically (for instance, with GO statements used in a structured manner) rather than with specific HLL structured operation codes.
The COBOL statements used to code the reading of a group of records from a file should be highly standardized.
A standard loop should be used because:
READ loop - COBOL ‘85:

|
Copyright © 2014 CA.
All rights reserved.
|
|