From the course: COBOL Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Perform statement

Perform statement - COBOL Tutorial

From the course: COBOL Essential Training

Start my 1-month free trial

Perform statement

- [Instructor] It's important to remember that COBOL is a sequential programming language which means that it starts with the first paragraph and the procedure division. And it continues to execute each command until it reaches a stop run. There are situations where you might need to redirect the execution of steps in a program. One option is using the GoTo command. Although there are not many situations where it's useful to use the GoTo command. There is one for example, in our data validation, if the incoming files if we encounter too many invalid records, it might be that the wrong file is being input into the program. So if the data in the files' corrupted, it makes sense to stop. Let's go back to our sales validation program. I've actually created an invalid sales dot dat file that all the records are invalid. So instead of processing the entire file, it makes sense that if I encounter let's say the first five…

Contents