Generating Edit and Code Tables › Stand-Alone Tables › Use of the NOT FOUND Condition
Use of the NOT FOUND Condition
The following examples illustrate the use of the NOT FOUND condition in the value list of a code table.
Example 4a
When NOT FOUND (a condition to be acted upon) is used in the encode column of a code table, the following occurs:
VALUES ARE
( 100 MATHEMATICS
200 ENGLISH
300 SCIENCE
NOT FOUND INVALID-DEPT-NO )
- On mapout, NOT FOUND is used as a catchall. At mapout, any value other than 100, 200, or 300 will match the NOT FOUND condition in the table. The corresponding value, INVALID-DEPT-NO will be moved to the map field.
- On mapin, NOT FOUND produces automatic editing errors under the following conditions:
- If the value entered does not match a decoded value and if there is no catchall value.
- If the value entered in the map field is INVALID-DEPT-NO the corresponding value is NOT FOUND instead of real value. As a result, the table is re-searched but no match is found.
Example 4b
When NOT FOUND is used in the decode column of the Code Table's value list, the following processing occurs:
VALUES ARE
( 100 MATHEMATICS
200 ENGLISH
300 SCIENCE
000 NOT FOUND )
- NOT FOUND is used as a catchall on map-ins. Any value entered in the map field, other than Mathematics, English, or Science will match the NOT FOUND condition and its corresponding value, 000, will be moved to the buffer.
- On mapout, NOT FOUND causes a program to abort as described:
- If a value in the buffer does not match an encoded value or a catchall, the user program will abort with the message, MAPPING DATA ERROR
- If 000 is the value in the buffer, its corresponding value is NOT FOUND. The encode values are then re-searched looking for a NOT FOUND condition. When there is no match, the application aborts.
Example 4c
When NOT FOUND is used in both the encode and decode column of a code table's value list as shown, the following processing occurs:
VALUES ARE
( 100 MATHEMATICS
200 ENGLISH
300 SCIENCE
000 NOT FOUND
NOT FOUND INVALID-DEPT-NO )
- On mapout and mapin, the NOT FOUND condition is used as a catchall:
- Any value other than ENGLISH, MATHEMATICS, or SCIENCE, that is entered in the map field will match the NOT FOUND condition in the decoded column and its corresponding value, 000, will be moved to the buffer on mapin.
- On mapin, if an invalid department number is entered in the map field, a match is found in the decode column and its corresponding value, NOT FOUND, is moved to the buffer. The decode column is then re-searched looking for NOT FOUND. When it is found, its corresponding value, 000, is moved to the map field.
- Any value other than 100, 200, 300, or 000 will match the NOT FOUND condition in the encode column, and its corresponding value, INVALID-DEPT-NO, is moved to the buffer.
- On mapout, if 000 is in the buffer, there is a match in the encode column and its corresponding value is NOT FOUND. The encode column is then re-searched looking for NOT FOUND. A match is found and its corresponding value, INVALID-DEPT-NO, is moved to the map field.
Copyright © 2013 CA.
All rights reserved.
|
|