From the course: COBOL Essential Training
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Perform times - COBOL Tutorial
From the course: COBOL Essential Training
Perform times
- [Instructor] As we're starting to see the Perform Verb in COBOL, has many different variations. The Perform Thru allows you to perform a block of code or even another paragraph until some condition is met. A very common use of Perform Thru is for processing records in a file. The program can perform THRU a sequence of steps until the end of file is reached. Let's look at our example here. This is a carsales program and you can see on line 127 I read the first record in the carsales file. At end, I set the end of sales file variable to TRUE I've added on line 130 a check to make sure the file was not empty. So if, I encounter end of sales file right away, I'm going to stop the run. Otherwise I'm going to perform THRU, paragraph 200 through 210 which will allow me to process the sales record and read the next one, until, end of sales file is reached. Let's scroll down and take a look. You can see that process sales…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Introduction to verbs3m 51s
-
(Locked)
Computational verbs7m 7s
-
(Locked)
Conditional expressions5m 36s
-
(Locked)
Perform statement3m 2s
-
(Locked)
Perform thru2m 30s
-
(Locked)
Perform times5m 9s
-
(Locked)
Challenge: Write code to simulate a cash register4m 13s
-
(Locked)
Solution: Simulated cash register4m 27s
-
-
-
-
-
-
-
-