In computer programs, it is often necessary to determine which action to take based on a complex set of conditions. You may end up coding a significant number of
If statements to handle these decisions. As you nest the
If statements deeper and deeper, the code can become very confusing. If you have to come back later and change the program, you may find yourself spending a lot of time just trying to figure out what you were attempting to do with all those
COBOL comes equipped with a very versatile statement as an alternative to using complex, highly nested
If statements. This statement is the
When to Use
After analyzing the decisions you need to make in your program, you ...