Validates a field value before it is stored in the record. Format VALID IF boolean-expression
1 – Argument
boolean-expression Is a DEC DATATRIEVE Boolean expression.
2 – Examples
The following example compares the value entered for the RIG field to the character strings SLOOP, KETCH, MS, and YAWL and stores the value in the field if it is one of those character strings: 06 RIG PIC X(6) VALID IF RIG EQ "SLOOP", "KETCH", "MS", "YAWL". The following example stores a value in the LOA field if it is between 15 and 50: 06 LENGTH_OVER_ALL PIC XXX VALID IF LOA BETWEEN 15 AND 50 QUERY_NAME IS LOA. The following example stores a value in the PRICE field if it is greater than 1.3 times the displacement or if it is zero: 06 PRICE PIC 99999 VALID IF PRICE>DISP*1.3 OR PRICE EQ 0 EDIT_STRING IS $$$,$$$.