The REDUCE option specifies that the compiler is permitted to reduce an assignment of a null string to a structure into simpler operations - even if that means padding bytes might be overwritten.
.-REDUCE---. >>-+-NOREDUCE-+------------------------------------------------><
The NOREDUCE option specifies that the compiler must decompose an assignment of a null string to a structure into a series of assignments of the null string to the base members of the structure.
When you specify the NOREDUCE option, BY NAME assignments that can be reduced to aggregate moves are not reduced if the elements that would be moved together had the AREA or VARYING, or VARYINGZ attributes.
The REDUCE option causes fewer lines of code to be generated for an assignment of a null string to a structure, and that usually means your compilation is quicker and your code is run much faster. However, padding bytes might be zeroed out.
For instance, in the following structure, there is one byte of padding between field12 and field13.
dcl
1 sample ext,
5 field10 bin fixed(31),
5 field11 bin fixed(15),
5 field12 bit(8),
5 field13 bin fixed(31);
Now consider the assignment sample = ’’;
Under the NOREDUCE option, it causes four assignments to be generated, and the padding byte is unchanged.
However, under REDUCE, the assignment is reduced to one operation, but the padding byte is zeroed out.