Field groups

Very often, an output data display field has to contain several subfields, all sharing the same display attributes, and each of which might have to be modified separately. At output, subfields that have not been modified by the program can adopt default data values from the output map. For example, a display can include a date field of a "day" subfield, "month" subfield, and "year" subfield. The contents of the year subfield remain constant over a relatively long period; its value can safely be taken from a map. However, the day value and month value must be updated regularly. Similarly, on input the terminal operator can enter data in each subfield separately.

You use the GRPNAME operand to define a group of subfields that combine to produce a field. The start of the group is indicated by a DFHMDF macro with the GRPNAME operand. This operand defines the first subfield, and specifies the attributes and name of the group. It is followed by other DFHMDF macros, one for each of the other subfields. Each of these must specify the group name, but cannot specify attribute values. The definition of the group is terminated by a DFHMDF macro that specifies a different group name, by one that specifies no group name, or by a DFHMDI or DFHMSD macro.

Briefly, a group of fields in a map would appear as follows in the map definition:
MAPSET DFHMSD....
       .
       .
MAP    DFHMDI....
       .
       .
DD     DFHMDF GRPNAME=DATE,POS=40,
              LENGTH=2,ATTRB=...
       .
MM     DFHMDF GRPNAME=DATE,POS=46,
              LENGTH=2
       .
YY     DFHMDF GRPNAME=DATE,POS=52,
              LENGTH=2
       .
FIELD  DFHMDF LENGTH=5,COLOR=GREEN,...
       DFHMSD TYPE=FINAL

The POS operand specifies the position of the attribute byte of the field even though subfields of a group, other than the first, do not have attributes. If the subfields are positioned contiguously with no intervening blanks, the POS of the second and succeeding subfields must specify the position of the last character of the previous subfield.