Previous Topic: Moving Map-Related DataNext Topic: Testing for Cursor Position


Testing for Global Map Input Conditions

This version of the INQUIRE MAP statement tests for one of the following global map input conditions:

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

 ►─── IF INPUT ─┬─ UNFORMATTED ─┬─ THEN imperative-statement; ────────────────►◄
                ├─ TRUNCATED ───┤
                ├─ CHANGED ─────┤
                └─ EXTRANEOUS ──┘
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 INPUT UNFORMATTED/TRUNCATED/CHANGED/EXTRANEOUS

Tests the outcome of the last map input request for conditions relating to the data input to the program:

UNFORMATTED

Tests whether the screen had been formatted before the input operation was performed.

TRUNCATED

Tests whether any of the map fields were truncated when transferred to variable-storage data fields.

CHANGED

Tests whether any of the map fields actually had been mapped to variable-storage data fields when the map input operation was performed.

EXTRANEOUS

Tests whether the input data stream contained any data from a field not defined to the map. If this condition is true, the undefined data field is ignored by the system.

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 illustrates an INQUIRE MAP statement that tests to determine if any fields in the EMPMAPLR map have been truncated and, if so, requests that the system perform the DATA_TRUNC routine:

INQUIRE MAP (EMPMAPLR)
  IF INPUT TRUNCATED
   THEN CALL DATA_TRUNC;