Sign in

docs RPG Reference

Z-ADD (Zero and Add)

Z-ADD (Zero and Add)

Free-Form Syntax(not allowed - use the EVAL operation code)
CodeFactor 1Factor 2Result FieldIndicators
Z-ADD (H)AddendSum+-Z

Factor 2 is added to a field of zeros. The sum is placed in the result field. Factor 1 is not used. Factor 2 must be numeric and can contain one of: an array, array element, field, figurative constant, literal, named constant, subfield, or table name.

The result field must be numeric, and can contain one of: an array, array element, field, subfield, or table name.

Half-adjust can be specified.

For the rules for the Z-ADD operation, see Arithmetic Operations.

See Figure 1 for an example of the Z-ADD operation.