Use this field-level keyword to map field data to a different value during input and output operations.
This keyword is only valid with the date (L), time (T), or timestamp (Z) data types.
MAPVAL((program-value-1 system-value-1) [(program-value-2 system-value-2) ... (program-value-100 system-value-100)])]
You can specify the program value and the system value either as explicit values or as the *BLANK or *CUR special values.
The *BLANK special value indicates field data that is composed of all blanks. The *CUR special value indicates that the date, time, or timestamp makes up the current field data, depending on the data type of the field.
During an output operation, the field data is compared to each program-value on the MAPVAL keyword in the order in which the program-values are specified. For the first match that is found, the corresponding system-value replaces the current field data. If a match does not exist, the field data does not change.
During an input operation, the field data is compared to each system-value on the MAPVAL keyword in the order in which the system-values are specified. For the first match that is found, the corresponding program-value replaces the current field data. If a match does not exist, the field data remains the same.
Option indicators are not valid for this keyword, although you can use option indicators to condition the field for which it is specified.
The following example shows how to specify the MAPVAL keyword.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A 00020A R RECORD 00030A DATFLD1 L DATFMT(*MDY) DATSEP('/') 00040A MAPVAL(('01/01/40' *BLANK))
On output, if the field data equals '01/01/40', the field data is changed to all blanks. On input, if the field data is blank, the field data is changed to '01/01/40'.