You can suppress the display of error messages for map fields. For example, you can code a data validation test so that it suppresses a map field's default error message and displays a different message when the field is in error.
What to Do
Include the ERROR MESSAGE IS ACTIVE/SUPPRESS parameter on your MODIFY MAP statement. ERROR MESSAGE immediately follows the REQUIRED/OPTIONAL parameter.
Example of Suppressing Error Messages
This COBOL example issues a MODIFY MAP statement that suppresses the display of default error messages for the ORDER-AMOUNT field on the current map.
In this application, the data validation routine compares the ORDER-AMOUNT field with the number of widgets on hand. If the current stock restricts the size of ORDER-AMOUNT, an alternative message is displayed.
DATA DIVISION. WORKING-STORAGE SECTION. 01 MESSAGES. 05 INITIAL-MESSAGE PIC X(80) VALUE 'ENTER A NUMERIC ORDER-AMOUNT AND PRESS ENTER'. 05 EDIT-ERROR-MESSAGE PIC X(80) VALUE 'ORDER-AMOUNT EITHER NOT ENTERED OR NOT NUMERIC'. 05 INVENTORY-MESSAGE PIC X(80) VALUE 'NOT ENOUGH WIDGETS IN STOCK TO DELIVER THAT AMOUNT'. 05 DISPLAY-MESSAGE PIC X(80) VALUE 'CLEAR TO EXIT ** ENTER ORDER-AMOUNT AND ENTER TO CONTINUE'
MODIFY MAP MAP01 TEMPORARY FOR DFLD ORDER-AMOUNT ERROR MESSAGE IS SUPPRESS.
If the data validation routine indicates that there are not enough widgets in stock, display the map with the alternative message.
TEMPORARY and PERMANENT Options
The use of the SUPPRESS option is affected by the TEMPORARY/PERMANENT option:
Copyright © 2013 CA.
All rights reserved.
|
|