%FIELDS(name{:name...})
A list of fields can be specified as the final argument to Input/Output
operation UPDATE coded in a free-form group. Only the fields specified
are updated into the Input/Output buffer.
Note: - Each name must be the name of a field in the input buffer for
the record. If the field is renamed, the internal name is used.
- The name can be a subfield from a data structure defined with
the EXTNAME/LIKEREC keyword using the file/format name of the record
being updated. *INPUT must be specified with the keyword used
and *NULL must not be specified. The
name specified must contain the subfield name that corresponds to
the input field. For a qualified data structure, the simple qualified
name of the subfield is used.
- The name can be a subfield of a data structure defined with the
LIKEDS keyword of a data structure defined as described above.
%FIELDS specifies a list of fields to update. For example:
Figure 1. Updating
Fields
/free
chain empno record;
salary = salary + 2000;
status = STATEXEMPT;
update record %fields(salary:status);
/end-free