Field-level exit programs have several uses. The most common use is to validate data. Some validation is built into tablesONLINE/ISPF; these built-in checks test only syntax. If not all numbers, dates, or character strings make sense in your application, then field-level exits can do further validation. For example, an exit program can test whether a gender field contains an acceptable value by looking for either an M or an F.
When the exit program encounters invalid data, it can set the error code to inform tablesONLINE about the error. If WS-EDIT-ERR is set to a non-zero integer and the ACTION-BYPASS-IND to N, processing does not proceed until the error is corrected. Consequently, if you enter an invalid value on the Item Edit screen, all the values are not processed until the error is corrected. The terminal user may exit the screen without processing by pressing <PF3>.
In addition to validating data, field-level exit programs can check that a value is within a specified range. They can also check for valid formats in entries whose data has a fixed format, such as part numbers, serial numbers, model numbers, employee numbers, department codes, and invoice numbers. Another use of field-level exit programs is data translation. For example, an exit program can match values to titles so that a user can specify a number in the department field which points to a department name that appears in the table.