Previous Topic: Reading Screen InputNext Topic: Writing and Reading in One Step


Modifying Map Options

Before issuing an input or output request, you may need to modify a map's WCC options or specify attributes for one or more map data fields. You can make modifications either for the length of the session or for the next mapping operation. For example, you may need to:

Steps to Modify a Map

To modify a map's WCC options or to specify attributes for one or more map data fields, perform the following steps:

  1. Issue mapping mode housekeeping statements

    For more information about housekeeping statements, see Housekeeping.

  2. Issue the MODIFY MAP command
  3. Issue either a MAP IN or MAP OUT statement

Example of Modifying a Map

The program excerpt below uses the MODIFY MAP statement to protect map data fields from operator input. The program is used in an application's initial MAP OUT to help ensure that the user will enter data in the correct field (EMP-ID-0415) by positioning the cursor and preventing input to all other map data fields.

 PROCEDURE DIVISION.
     BIND MAP SOLICIT.
     BIND MAP SOLICIT RECORD EMPLOYEE.
     BIND MAP SOLICIT RECORD EMP-DATE-WORK-REC.
*** SET CURSOR AND PREVENT INPUT INTO ALL BUT EMP-ID-0415 ***
     MODIFY MAP SOLICIT TEMPORARY
        CURSOR AT DFLD EMP-ID-0415
        FOR ALL EXCEPT DFLD EMP-ID-0415
        ATTRIBUTES PROTECTED.
*
     MOVE ZERO TO EMP-ID-0415.
     MAP OUT USING SOLICIT
        YES NEWPAGE
        MESSAGE IS INITIAL-MESSAGE TO INITIAL-MESSAGE-END.
*
     DC RETURN
        NEXT TASK CODE TSK02.