Changing the attributes
Field attributes in map definitions can be changed using the options MAPATTS and DSATTS.
Here is an example of how this works. Suppose that the terminals
in our “quick check” application have color and highlighting capabilities.
We might decide to show the maximum charge allowed in a different
color from the rest of the screen, because this field is of most interest
to the clerk. We might also make the warning message red, because
when it appears at all, it is important for the clerk to notice it.
And when we really want to get the clerk's attention, because the
card is stolen, we could change the attributes in the program to make
the message flash. To add these features, we need to change our map
definition as follows:
QCKMAP DFHMDI SIZE=(24,80),..., X
MAPATTS=(COLOR,HILIGHT),COLOR=GREEN,HILIGHT=OFF,DSATTS=HILIGHT The
MAPATTS option tells BMS that we specify color and highlighting in
the map (or in the program, because any attribute listed in DSATTS
must be included in MAPATTS as well). The COLOR and HILIGHT values
indicate that fields with no color assigned should be green and that
highlighting should be off if not specified.
The only field definitions that we need to change are the ones that are
not green or are highlighted:
CHG DFHMDF POS=(5,13),LENGTH=8,ATTRB=(ASKIP,NORM),PICOUT='$,$$0.00', X
COLOR=NEUTRAL
MSG DFHMDF LENGTH=20,POS=(7,1),ATTRB=(ASKIP,NORM),COLOR=RED Specifying
COLOR=NEUTRAL means that on a terminal, the field is displayed in
white.The DSATTS option tells BMS that we want to alter the highlighting
of some fields at execution time, and therefore it should produce
“H”-suffix subfields in the symbolic map to let us do that. Each named
field gets the extra subfield; the message field, for example, expands
from the current three lines in Figure 3 to:
02 FILLER PICTURE X(2).
02 MSGH PICTURE X.
02 MSGA PICTURE X.
02 MSGO PIC X(30). The program statement
we need to produce the flashing is: MOVE DFHBLINK to MSGH. In
general, BMS takes attribute values from the program if you supply
them and from the map if you do not (that is, if you leave the program
value null, as initialized). However, the MAPONLY and DATAONLY options
on the SEND MAP command affect attribute values as well as field data,
as explained in Where the values come from in Building the output screen.