Previous Topic: Testing for Cursor PositionNext Topic: KEEP CURRENT


Testing for Input Error Conditions

This version of the INQUIRE MAP statement tests:

Syntax
►►─── INQUIRE MAP (map-name) ─────────────────────────────────────────────────►

 ►─ IF ┬─ CURRENT ──────────────────────────────────────────────────────────┬►─
       ├─ ALL ──────────────────────────────────────────────────────────────┤
       ├─ NONE ─────────────────────────────────────────────────────────────┤
       ├─ ANY ──────────────────────────────────────────────────────────────┤
       ├─ SOME ─────────────────────────────────────────────────────────────┤
       ├─ ALL ─┬─ BUT ────┬─ CURRENT ───────────────────────────────────────┤
       │       └─ EXCEPT ─┘                                                 │
       │                       ┌─────────────────────┐                      │
       ├┬─ ALL ──────────────┬─▼─ DFLD (field-name) ─┴──────────────────────┤
       │├─ NONE ─────────────┤                                              │
       │├─ ANY ──────────────┤                                              │
       │├─ SOME ─────────────┤                                              │
       │└─ ALL ─┬─ BUT ────┬─┘                                              │
       │        └─ EXCEPT ─┘                                                │
       │ ┌─────────────────────┐                                            │
       └─▼─ DFLD (field-name) ─┴────────────────────────────────────────────┘

─►──┬─ DATA ─┬─ YES ───────┬─┬────────────────────────────────────────────────►
    │        ├─ NO ────────┤ │
    │        ├─ ERASE ─────┤ │
    │        ├─ TRUNCATED ─┤ │
    │        ├─ IDENTICAL ─┤ │
    │        └─ DIFFERENT ─┘ │
    └─ EDIT ─┬─ ERROR ───┬───┘
             └─ CORRECT ─┘

 ►── THEN imperative-statement; ──────────────────────────────────────────────►◄
Parameters
MAP (map-name)

Specifies the map for which the inquiry is being made. Map-name is the 1- to 8-character name of a map that must correspond to a map name specified in the DECLARE MAP statement, as described in DML Precompiler-Directive Statements.

IF CURRENT/ALL/NONE/ANY/SOME/ALL BUT (EXCEPT) CURRENT

Specifies the map fields to which the test applies:

CURRENT

Applies the test only to the current field; that is, the map field that was referenced in the last MODIFY MAP or INQUIRE MAP statement issued by the program. If the last MODIFY MAP or INQUIRE MAP statement specified a field list, no currency exists.

ALL

Specifies that the test is true if all map fields meet the specified condition.

NONE

Specifies that the test is true if none of the map fields meet the specified condition.

ANY

Specifies that the test is true if one or more of the map fields meet the specified condition.

SOME

Specifies that the test is true if one or more but not all of the map fields meet the specified condition.

ALL BUT CURRENT

Specifies that the test is true if all of the map fields except for the current field meet the specified condition. The keywords BUT and EXCEPT are synonymous.

IF ALL/NONE/ANY/SOME/ALL BUT DFLD (field-name)

Specifies the extent to which the condition applies to the map fields.

ALL

Specifies that the test is true if all of the named map fields meet the specified condition. ALL is the default.

NONE

Specifies that the test is true if none of the named map fields meet the specified condition.

ANY

Specifies that the test is true if one or more of the named map fields meet the specified condition.

SOME

Specifies that the test is true if one or more but not all of the named map fields meet the specified condition.

ALL BUT

(Release 10.2 only) specifies that the test is true if all of the data fields except the named map fields meet the specified condition. The keywords BUT and EXCEPT are synonymous.

IF DFLD (field-name)

Specifies the individual map fields to which the test conditions apply. Field-name must be the name of a field within the named map. Multiple DFLD specifications must be separated by at least one blank.

DATA IS

Specifies the input test condition.

YES

Determines if the terminal operator entered data in the named map fields.

NO

Determines if the terminal operator did not enter data in the named map fields.

ERASE

Determines if data has been erased from the named map fields.

TRUNCATED

Determines if data has been truncated in the named map fields.

IDENTICAL

Determines whether input data is identical to the map data currently in the program's variable storage. IDENTICAL is true in either of the following cases:

  • The field's modified data tag (MDT) is off. On mapin, the MDT typically is off if the user did not type any characters in the field.
  • The MDT is on, but each character in the input data is exactly the same as data in variable storage, including capitalization.
DIFFERENT

Determines whether input data is different from the map data currently in the program's variable storage. DIFFERENT is true if the field's MDT is on and at least one input character differs from the data in variable storage.

EDIT

Automatic editing/error handling tests for errors in the named map fields.

Note: If the EDIT parameter is specified, automatic editing must be enabled for the map and for each of the named map fields.

ERROR

Determines if the named map fields were found to be in error during automatic editing.

CORRECT

Determines if the named map fields were found to be correct during automatic editing.

THEN imperative-statement

Specifies the action to be taken when the test condition is true. Imperative-statement can be a single PL/I statement, a DML statement, or a nested block of PL/I and DML statements.

Example

The following example determines if automatic editing has detected erroneous data in any field in the EMPMAPLR map; if so, the program modifies the map temporarily to display the erroneous fields with the bright and blinking attributes:

INQUIRE MAP (EMPMAPLR)
  IF ANY EDIT ERROR
   THEN MODIFY MAP (EMPMAPLR) TEMPORARY
      FOR ALL ERROR FIELDS
      ATTRIBUTES BRIGHT BLINK;
Status Codes

Upon completion of the INQUIRE MAP function, the ERROR_STATUS field of the IDMS DC communications block indicates the outcome of the operation:

0000

The request has been serviced successfully.

4629

An invalid parameter has been passed from the program.

4641

The test condition has been found to be true. (This condition is tested for automatically by PL/I DML expansion statements.)

4644

The referenced map field is not in the specified map; a possible cause is a reference to an invalid map field subscript.

4656

The referenced map contains no data fields.