%FIELDS Built-In Functions in rpgle
%FIELDS funtion is used to partially update a file. In other words, we may need to update only 1 or 2 fields of a file. For that we use this funtion.
Format of %FIELDS function is: %FIELDS(field1: field2: ....)
In the parameter of %FIELDS, We enter the fields name we want to update in file. Only the mentioned fields are updated.
Example –%fields built-in function in rpgle
In the example below, ACCMNGR and COUNTRY will be updated for physical file(ACCOUNT) with record format(rec5).