DFHMDF Macro


DFHMDF abbreviates as Defined Field Hierarchy Map Definition Fields. The screen layout should be designed before attempting to code any macros. After that has done, define each field on the screen (page) with a DFHMDF macro. DFHMDF used to define a field with its characteristics in a MAP.

Each DFHMDF entry refers to one specific individual field definition. A MAP definition can contain multiple number of DFHMDF entries. DFHMDF can have multiple fields defined in single MAP. Using DFHMDF macro, we can indicate -

  • The field position on the screen.
  • The field length.
  • The default contents.
  • The field display attributes.
  • Extended display attributes for some terminals such as colour, underlining, highlighting.
  • The name to refer the field in program, if required modify its contents or attributes.

Fields referenced by the application program must allocate field names. The field names must follow to the following rules: -

  • The characters set consists of the alphabetic characters A - Z (upper or lower case), $, #, @, numeric digits (0 - 9), and the underscore (_) character. In addition, the characters used in field names must conform to the character set supported by the programming language using the map.For example, COBOL doesn’t support @.
  • The hyphen (-) character can be used in field names if the map set is only used by COBOL application programs and map set is generated using the High-Level Assembler.
  • The field name first character must be alphabetic and from second character can be any from the character set described previously.
  • The DFHMDF macro allows the field names length to be from 1 through 30 characters.
  • DFHMDF appending one of several additional characters(Length(L), flag(F), attribute(A), input(I) and output(O)) to derived name to generate a symbolic description map.
  • These derived names can therefore be up to 31 characters in length. The assembler, PL/I and C languages all support variable names of at least 31 characters. However, the COBOL language only allows up to 30 characters and must not exceed 29 characters.

Syntax -


DFHMDF Syntax

Parameters -


Most of the options described by considering COBOL is the programming language.

LENGTH -


LENGTH option specifies the field length (how many characters long). The length doesn’t include attribute byte. So, each field length is calculated as field actual length plus 1-column for attribute.Length of the field can be up to 256 characters long. Length only required when PICOUT option specifies.

JUSTIFY -


JUSTIFY option specifies the field to be positioned for input.

JUSTIFY=LEFT specifies that the data in the input field is left justified.

JUSTIFY=RIGHT specifies that the data in the input field is right justified.

JUSTIFY=BLANK specifies that blanks are to be inserted in the unfilled positions of the field.

JUSTIFY=ZERO specifies that zeroes are to be inserted in the unfilled positions of the field.

PICIN -


Specifies the input field picture clause of the particular field for the symbolic map. If PICIN omitted, then BMS assumes numeric attribute also as Character data. Applicable only for COBOL and PL/I programming languages.

PICOUT -


Specifies the output field picture clause of the particular field for the symbolic map. If PICOUT omitted, then BMS assumes numeric attribute also as Character data. It allows to use the edit facilities of COBOL and PL/I, to move data into map. Applicable only for COBOL and PL/I programming languages.

POS -


The POS (position) parameter indicates the row and column position of the field. Used to specify the positions of the field on the MAP. For example, relative to the upper left corner of the map position (1,1).

POS can be determined by using two arguments: Rows and Columns. POS parameter is mandatory for every field. Note that every field begins with field attribute byte. POS defines the location of this byte and the content followed immediately right after the attribute byte.

INITIAL -


Used to specify the default value of the field which required to display during the first display of the MAP on the screen. The INITIAL value for the field is not required either. When the MAP is sent first time, this value filled in the field to appear. Normally, INITIAL used it for label and title fields that have a constant value and program doesn’t required to supply any value.

COLOR -


Indicates the individual color or the default color for the map set (where applicable). The valid colors are blue, red, pink, green, turquoise, yellow and neutral.

HILIGHT -


Specifies the default highlighting attribute for all fields in all maps in a map set. HILIGHT valid values are – OFF, BLINK, REVERSE and UNDERLINE.

OFF indicates no highlighting is used and is the default.

BLINK specifies the field must flash.

REVERSE specifies the character or field is displayed in reverse video.

UNDERLINE specifies a field is underlined.

GRPNAME -


Specifies the character name used to generate symbolic storage definitions and to combine specific fields under one group name. It can be 1 through 30 characters. The same group name must be specified for each field that is to belong to the group. If this operand is specified, the OCCURS operand cannot be specified.

ATTRIB -


ATTRIB option sets the field characteristics and attributes of the field. All input and output fields can be prefixed by one-byte attribute. It is an optional and not required to set. If omits this option, BMS uses a default value of auto skip protection(ASKIP), normal intensity(NORM), modified data tag off. The attribute byte of any field stores information about properties of the field. The below diagram table explains each bit importance.

Attribute Byte
Bit PositionDescriptionBit Settings
1 & 2 Determined by contents of bit 2 to 7
3 Protection0 - Unprotected 1 - Protected
4 ShiftBehaviour can be decided based on the protection bit.If Protection bit is zero(0), then the Shift determines
  • 0 - Alphanumeric
  • 1 – Numeric
If Protection bit is one(1), then the Shift determines
  • 0 - Stop
  • 1 - Skip
4 & 5Intensity00 - Normal01 - Normal10 - Bright11 - No-display ( Dark )
6 Must be Zero Always
7Modified Data Tag0 - Field has not been modified1 - Field has been modified

The attributes values are -

ASKIP specifies that user can’t able to enter the data into the field.When user enters tab from previous field, control will skip the field because of ASKIP attribute and places control to next field.The cursor automatically skipped to next field and user can’t able to enter the data.

PROT Specifies that user can’t able to enter the data into the field.But cursor can be placed on the same field.PROT is coded for output and stopper fields.UNPROT is coded for input-output fields and specifies the data can be keyed into the field.

BRT specifies the field should be highlighted with high intensity. NORM specifies the field should be highlighted with normal intensity.

DET specifies that the field is potentially detectable. DET and DRK are mutually exclusive. DRK specifies the field should not be highlighted or not printed or not displayed. DRK cannot be specified if DET is specified.

FSET value specifies the MDT (Modified Data Tag) used to check whether the specific field is modified or not while receiving the MAP. MDT returns the modification status of the field to the application program and uses for validation of the field modification.

What is MDT?


  1. MDT is abbreviated as Modified Data Tag.
  2. MDT is one-bit field(8th position) of the attribute byte.
  3. There are ON(1) and OFF(0) values for MDT.
  4. The program can receive only the fields which are modified on RECEIVE i.e. MDT as ‘1’.
  5. If the user modifies the field, then MDT of the field is automatically set to ON(1) and receives the same to the application program.

NUM -


Only numeric fields allowed. i.e. 0-9, period and are the only allowed characters. It will not allow any alphanumeric characters.

IC -


Used to specify cursor placement while sending the MAP to the screen . By default, IC can be placed on the first field or top left corner of the screen. If IC specified to any single field, then the CURSOR will be placed on the field for which IC was specified. If IC can be coded for more than one field, then all will be ignored and the cursor will be placed at the first field for which IC was specified.

What is CURSOR positioning?


CURSOR positioning is process of placing a cursor on the screen while displaying the MAP on the screen or SEND MAP command executes. Normally, the CUSOR positioning can be done in the below three ways -

  1. Static positioning - By specifying IC on the DFHMDF, user can set the cursor positioning on the specific field before map sent to screen.
  2. Symbolic positioning - Moving -1 to length field to place the cursor on the specific field. This process needs to be handled through program. This method used to control the cursor position dynamically.
  3. Cursor position - A half word binary field used to send the offset of cursor position on the screen. Offset of cursor position will be sent in EIBPOSN of DFHEIBLK to the screen while transferring the data from the application program to the terminal.

What are the types of attribute setting?


There are two ways of attribute setting to the fields.

  • Static attribute setting - Setting attributes during the MAP creation.
  • Dynamic attribute setting - Setting attributes in the application program before sending MAP to display on screen.