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.
Searching tables in COBOL - COBOL Tutorial
From the course: COBOL Essential Training
Searching tables in COBOL
- [Instructor] An important feature of cobol is the ability to search tables. In cobol there's two search verbs, search and search all. By default tables are searched sequentially. Tables can be either sorted or unsorted, but to use the search verb alone. A table must include the indexed by phrase. The program then starts the search at index one and continues until either the value is found or it reaches the end of table. The search all verb executes a binary search and it requires a key is phrase. As with any binary search the table must be in sorted order prior to the search. Using an index value increases the program efficiency when using the search verb. To demonstrate searching a table I have a copy of the create table program. Let's go over to visual studio now. We want to update this program to allow it to search based on the skew value. It's easy to ensure the table is sorted by adding either the word ascending…
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.