DFHMDI Macro
DFHMDI Macro
The DFHMDI (Define Map Definition Interface) macro is a Basic Mapping Support (BMS) macro used to define individual maps within a mapset. A map is a layout that structures how data appears on a 3270 terminal screen, including fields for input and output. The DFHMDI macro is part of a BMS mapset and defines the characteristics of a specific screen format, including its size, position, and attributes.
Purpose -
- Defines the size, positioning, and attributes of a screen map.
- Specifies input and output fields for user interaction.
- Ensures consistent formatting of data on CICS terminal screens.
- Works in combination with DFHMSD (Mapset Definition) and DFHMDF (Field Definition) macros.
Syntax -
map-name DFHMDI SIZE=(rows,columns),
LINE=row-position,
COLUMN=column-position,
CTRL={FREEKB|PRINT|FRSET|ALARM},
COLOR=color-name,
HILIGHT={OFF|BLINK|REVERSE|UNDERLINE}
- SIZE=(rows, columns) - Defines the screen dimensions of the map in terms of rows and columns. Example:
SIZE=(24,80)
. - LINE=row-position - Specifies the starting row position of the map on the screen. Example:
LINE=1
. - COLUMN=column-position - Specifies the starting column position of the map. Example:
COLUMN=1
. - CTRL=FREEKB|PRINT|FRSET|ALARM
- FREEKB: Unlocks the terminal keyboard after the map is sent.
- FREEKB: is used to send the map to printer.
- FRSET: Resets the Modified Data Tag (MDT) for all fields in the map.
- ALARM: specifies the alarm feature is to be activated.
- COLOR=color-name - Specifies the color used for the map. Valid colors are blue, green, neutral, pink, red, turquoise, and yellow. If the default value of the output device is ignored, it is to be used as the basic color for this map.
- HILIGHT=OFF|BLINK|REVERSE|UNDERLINE
- OFF: is default and indicates no highlighting is used.
- BLINK: used to specify to field must blink.
- REVERSE: used to specify character or field displayed in reverse.
- UNDERLINE: used to underline the field. If the terminal doesn't support highlighting, these parameters is ignored.
Examples -
Scenario - Customer Inquiry Mapset
- Mapset name - CUSTINQ
- Map name - CUSMAP
CUSTINQ DFHMSD TYPE=MAP,
MODE=INOUT,
LANG=COBOL,
CTRL=FREEKB,
STORAGE=AUTO,
TIOAPFX=YES,
TERM=3270
CUSMAP DFHMDI SIZE=(24,80),
LINE=1,
COLUMN=1,
CTRL=(FREEKB,FRSET)
...
DFHMSD TYPE=FINAL
END
Explanation - DFHMDI (Map Definition)
- CUSMAP is the map name.
- SIZE=(24,80): Defines a 24-row × 80-column screen.
- LINE=1, COLUMN=1: Positions the map at the top-left corner.
- CTRL=(FREEKB,FRSET): Unlocks the keyboard after displaying the map and resets Modified Data Tags (MDT).
Usage in CICS Program -
The DFHMSI macro defines the map. The application program used the mapset to send and receive the data using CICS commands like SEND MAP and RECEIVE MAP.
- Map name - CUSMAP
- Mapset name - CUSTINQ
IDENTIFICATION DIVISION.
PROGRAM-ID. CUSTINQR.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-VAR.
...
LINKAGE SECTION.
01 DFHCOMMAREA PIC X(10).
PROCEDURE DIVISION.
EXEC CICS SEND
MAP('CUSMAP')
MAPSET('CUSTINQ')
ERASE
END-EXEC.
IF EIBAID = 'ENTER' THEN
EXEC CICS RECEIVE
MAP('CUSMAP')
MAPSET('CUSTINQ')
INTO (CUSMAPO)
END-EXEC.
...
...
END-IF.
EXEC CICS
RETURN
END-EXEC.
GOBACK