There is an additional advantage to the 88's, if you use them consistently and code them correctly.
Say you have values that change, but the logic to handle them remains constant. At my company we have several companies we to business with that have various reporting requirements to the different state governments. I code:
01 WHATEVER-RECORD.
05 COMPANY-CODE PIC 9(4).
88 CALIFORNIA-COMP VALUES 12
60 THRU 61
89 THRU 91
97.
88 FLORIDA-COMP VALUE 39.
88 NEVADA-COMP VALUES 20
26.
Then in my PROCEDURE DIVISION, I can code meaningful names, like this:
EVALUATE TRUE
WHEN CALIFORNIA-COMP
PERFORM CALIFORNIA-PROCESSING
WHEN FLORIDA-COMP
PERFORM FLORIDA-PROCESSING
WHEN NEVADA-COMP
PERFORM NEVADA-PROCESSING
END-EVALUATE.
Now the beauty of this is that even if you have fifty different such evaluates that do fifty different sets of things depending on the company's state, all you have to do to implement a new company is add its value to the appropriate 88. The PROCEDURE DIVISION is already coded correctly. My company is adding and deleting different companies to these lists all the time. Put the 88's in a copy book and all you have to do is update the copy book and re-compile the state specific programs. This is handy when you have fixed logic, but the conditions under which you want to execute that logic is subject to frequent change. Another good application is income tax brackets, which change due to circumstances beyond the programmer's control.
Gelthie, regarding your original question on data validation, generic validation is usually done with class tests like
IF NUM-ITEM IS NUMERIC
or
IF ALPH-ITEM IS ALPHABETIC
Specific tests for values in ranges or on a list are done with 88's. For my company example above you might code:
IF NOT CALIFORNIA-COMP AND NOT FLORIDA-COMP AND NOT NEVADA-COMP
PERFORM STATE-ERROR-HANDLING
END-IF.
Hope this helps Betty Scherber
Brainbench MVP for COBOL II