DFTVAL (Default Value) Keyword for Display Files--Example

Figure 138 shows how to specify the DFTVAL keyword.

Figure 138. Specifying the DFTVAL Keyword

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A          R RECORD1
A  50                                  PUTOVR
A            FIELD1         3A  B 12 01DFTVAL('AAA') OVRDTA
A            FIELD2         3D 0O 12 05OVRDTA
A  10                                  DFTVAL('000')
A            FIELD3         3D 0O 12 09DFTVAL('000') OVRDTA
A

In Figure 138, prior to displaying the record, the application program assigns "ZZZ" to FIELD1, "999" to FIELD2, and "456" to FIELD3. On the first output operation, "AAA 000 000" displays if indicator 10 is on; "AAA 999 000" displays if indicator 10 is off.

The work station user types "XXX" into FIELD1. On the second output operation, "XXX 999 456" displays if indicator 50 is on; 'AAA 000 000' displays if indicator 50 is off and indicator 10 was on during the first output operation. 'AAA 999 000' displays if indicator 50 is off and indicator 10 was off during the first output operation.