Previous Topic: HousekeepingNext Topic: Reading Screen Input


Displaying Screen Output

To display a map on the terminal screen, perform the following steps:

  1. Issue mapping mode housekeeping statements as described above.
  2. Initialize variable-storage data fields as needed.
  3. Transfer data from variable-storage data fields to map fields on the screen by issuing a MAP OUT statement.

You can also use the MAP OUT 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 output considerations. For more information, see Using Pageable Maps.

Mapping Considerations

You need to know about the following considerations when writing a program that displays maps:

Sending Informational Messages

You can send a variety of messages to the user's terminal, depending on the situation. For example, if the application is being accessed for the first time, you might transmit the following message:

ENTER AN EMPLOYEE ID AND PRESS ENTER ****  PRESS CLEAR TO EXIT
You might send a different message with the same map at another time to indicate the completion status of a task:
****  SPECIFIED EMPLOYEE CANNOT BE FOUND  ****

'COBOL and PL/I programmers'. To avoid unpredictable results at run time, specify messages that are 100 bytes or less in length.

Keeping the Data Stream Short

Because you want to promote the fastest possible response time, an important programming consideration is the length of the data stream transmitted to or from the terminal. You should ensure that your program always transmits the smallest amount of data necessary to successfully complete a mapping operation.

Ways to minimize the data stream include:

Synchronous and Asynchronous Processing

Mapping mode supports synchronous and asynchronous map output operations:

Example of an Initial Application Screen

The program excerpt below displays an application's initial screen. It initializes the EMP-ID-0415 field and displays the screen, soliciting user input.

 DATA DIVISION.
 WORKING-STORAGE SECTION.
 01  TSK02                         PIC X(8)  VALUE 'TSK02'.
 01  MESSAGES.
     05 INITIAL-MESSAGE            PIC X(54) VALUE
      'ENTER AN EMPLOYEE ID AND PRESS ENTER *** CLEAR TO EXIT'.
     05 INITIAL-MESSAGE-END        PIC X.
 PROCEDURE DIVISION.
*** ESTABLISH ADDRESSABILITY TO MAP ***
     BIND MAP SOLICIT.
*** ESTABLISH ADDRESSABILITY TO MAP RECORDS ***
     BIND MAP SOLICIT RECORD EMPLOYEE.
     BIND MAP SOLICIT RECORD DATE-WORK-REC.
     MOVE ZERO TO EMP-ID-0415.
*** DISPLAY THE MAP ***
     MAP OUT USING SOLICIT
        WAIT NEWPAGE
        MESSAGE IS INITIAL-MESSAGE TO INITIAL-MESSAGE-END.
*** RETURN CONTROL TO CA-IDMS/DC NEXT TASK TSK02 ***
     DC RETURN
        NEXT TASK CODE TSK02.