An exit program at the row level provides more validation than at the field level. The following example illustrates how an exit program at the row level can validate a Salary field.
A field-level exit program could check that the value is a positive integer less than 200,000. This limit is too general to be very helpful in preventing errors. A row-level exit program, on the other hand, could validate pay rates against limits for each job category. Because pay rates would depend on information in another field of the row, the exit program must be in effect at the row level.
The code to implement this validation is a table lookup with Job Category as key and an upper and lower boundary as retrieved data. This system is easily maintained; if pay scales change you can update the boundary table entries and future validations will use the new scales.
Since all fields in the row are available, more complex conditions can be set up by indexing the DATA-ARRAY-NEW and HOOK-POINTER. For example, pay scales may vary with location as well as job category. This could be handled by incorporating the additional validation into the table; location, as well as category, could be part of the key.