To display a map on the terminal screen, perform the following steps:
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:
The ATTRIBUTE specification is useful when sending error messages to the terminal because DC still transmits the data in the message field. For example, you could minimize the data stream transmitted by coding the following MAP OUT statement:
MAP OUT USING DEPTMAP
OUTPUT DATA IS ATTRIBUTE MESSAGE IS ID-EDIT-ERROR-MESS TO ID-EDIT-ERROR-MESS-END.
If automatic editing and error handling are enabled and you use the ERROR option of the MODIFY MAP statement, the ATTRIBUTE specification is automatically invoked.
Synchronous and Asynchronous Processing
Mapping mode supports synchronous and asynchronous map output operations:
To issue a synchronous map output request, specify the WAIT option of the MAP OUT statement. This option allows you to ensure that the output request was completed successfully before continuing program processing.
To issue an asynchronous map output request, specify the NOWAIT option of the MAP OUT statement.
You may want to specify NOWAIT if your program issues a MAP OUT just before task termination. This causes DC to release a task's resources sooner. In this case, however, you cannot issue the CHECK TERMINAL statement; you won't be able to determine the completion status of the MAP OUT operation.
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.
Copyright © 2013 CA.
All rights reserved.
|
|