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.
Inspecting strings in COBOL - COBOL Tutorial
From the course: COBOL Essential Training
Inspecting strings in COBOL
- [Instructor] When we define variables as alphanumeric we often need to evaluate individual characters within the field. There are three string operations that I want to address inspect string and unstring this movie, I will show you an example that uses the inspect verb. The Inspect verb can be used for counting characters in a string, replacing one group of characters in a string with another group, and even converting a set of characters to another set of characters, such as converting a string from uppercase to lowercase or vice versa. For this example, we're going to use a file of employees. The employee input file contains the social security number followed by the name the birth date, the gender, and an email address in order to correctly format a report of all employees. I need to take the nine digit social security number as input and I want to print it using hyphens to format the number according to the social…
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.