Previous Topic: Displaying Screen OutputNext Topic: Modifying Map Options


Reading Screen Input

When the user finishes inputting data and presses an AID key, DC invokes the specified input task. The task reads data from the screen and tests for certain input conditions.

To transfer data from map fields on the terminal screen to the corresponding variable storage data fields, perform the following steps:

  1. Issue mapping mode housekeeping statements, as explained in Housekeeping.
  2. Transfer data from map fields on the terminal screen to variable-storage data fields by issuing a MAP IN statement.

You can use the MAP IN statement to transfer data between two variable-storage data fields; this is referred to as a native mode data transfer.

For more information about native mode data transfers, see the language-specific CA IDMS DML Reference Guide.

Pageable maps have different input considerations. For more information, see Using Pageable Maps.

Example of Reading Input

The program excerpt below reads data from the screen.

It transfers data from the terminal screen to map data fields in program variable storage by issuing a MAP IN statement.

 PROCEDURE DIVISION.
*** ESTABLISH ADDRESSABILITY TO THE MAP ***
     BIND MAP SOLICIT.
*** ESTABLISH ADDRESSABILITY TO THE MAP RECORDS ***
     BIND MAP SOLICIT RECORD EMPLOYEE.
     BIND MAP SOLICIT RECORD EMP-DATE-WORK-REC.
*** TRANSFER DATA FROM MAP DATA FIELDS TO VARIABLE STORAGE ***
     MAP IN USING SOLICIT.
*** FURTHER PROCESSING OF ENTERED DATA ***

Testing for Input Conditions

After a MAP IN request, your program can inquire about conditions related to the input operation. For example, you may need to perform processing based on the AID key pressed by the user or determine if the user entered data in a particular map data field.

To test for conditions related to a map input operation, issue an INQUIRE MAP statement. By using this statement, you can obtain the following information:

Frequent uses of the INQUIRE MAP statement are listed below:

Key

AID character

Enter

" ' " (single quote)

Clear

'_' (underscore)

PF1

'1'

PF2

'2'

PF3

'3'

PF4

'4'

PF5

'5'

PF6

'6'

PF7

'7'

PF8

'8'

PF9

'9'

PF10

':'

PF11

'#'

PF12

'@'

PF13

'A'

PF14

'B'

PF15

'C'

PF16

'D'

PF17

'E'

PF18

'F'

PF19

'G'

PF20

'H'

PF21

'I'

PF22

'&cent.'

PF23

'.'

PF24

'<'

PA1

'%'

PA2

'>'

PA3

','

You can use the TASK CODE parameter of the ACCEPT statement to retrieve the calling task code.

For more information about the ACCEPT statement, see Retrieving Task-Related Information.

The program excerpt below performs processing based on conditions related to the last map input operation. It uses the INQUIRE MAP statement to determine what control key was pressed and to ensure that the DEPT-ID-0410 field contains data.

 DATA DIVISION.
 WORKING-STORAGE SECTION.
 01  DC-AID-CONDITION-NAMES.
      03  DC-AID-IND-V           PIC X.
                             88  ENTER-HIT VALUE QUOTE.
                             88  CLEAR-HIT VALUE '_'.
 PROCEDURE DIVISION.
*** ESTABLISH ADDRESSABILITY TO THE MAP AND MAP RECORDS ***
     BIND MAP SOLICIT.
     BIND MAP SOLICIT RECORD EMPLOYEE.
     BIND MAP SOLICIT RECORD DEPARTMENT.
     BIND MAP SOLICIT RECORD EMP-DATE-WORK-REC.
*** TRANSFER DATA FROM THE MAP TO VARIABLE STORAGE ***
     MAP IN USING SOLICIT.
*** DETERMINE THE AID KEY PRESSED BY THE TERMINAL OPERATOR ***
     INQUIRE MAP SOLICIT
         MOVE AID TO DC-AID-IND-V.
*** IF OPERATOR PRESSED CLEAR THEN DC RETURN ***
     IF CLEAR-HIT DC RETURN.
*** DETERMINE IF THE TERMINAL OPERATOR     ***
*** ENTERED DATA IN THE DEPT-ID-0410 FIELD ***
     INQUIRE MAP SOLICIT
         IF DFLD DEPT-ID-0410
            DATA IS NO
            GO TO A100-NO-DATA.
        .
*** FURTHER PROCESSING OF ENTERED DATA ***