From the course: Migrating COBOL Apps

Unlock the full course today

Join today to access over 24,300 courses taught by industry experts.

Legacy control flow

Legacy control flow - COBOL Tutorial

From the course: Migrating COBOL Apps

Legacy control flow

- [Presenter] Legacy COBOL was being used to build major application suites well before anybody thought of ideas such as structured coding or object orientation. Consequently, it has many coding constructs which are frowned on today, such as the GoTo statement. Using GoTo statements as a sure way to create what's known as spaghetti code in which the execution flows like strands of spaghetti through the code modules. This makes it difficult to keep track of exactly what code will be executed for each program function. Associated with the GoTo is the alter statement which enables code to be modified during execution. Meaning that static analysis doesn't reflect the control flows in the code. COBOL includes a perform verb which can be used to execute a paragraph or a series of paragraphs. However, this means that subsequent maintenance to that area of code, risks breaking the control flow. The perform verb doesn't allow for…

Contents