DFSORT OUTREC arithmetic with numeric and constants

DFSORT OUTREC: Editing numeric fields DFSORT OUTREC: Date Operations

Advertisements


OUTREC statement can be used for arithmetic operations on the numeric data in the file.

Syntax:
OUTREC FIELDS=(starting position of field1, length of field1,
		field1 source format, Arithmetic Operator, +n/-n,….. )

Name Description
Starting position of field1Specifies field1 starting position in the input file after sorting.
Length of feild1Field1 physical length in input file.
Field1 Source format Specifies the field1 source format
Arithmetic Operator Specifies the arithmetic operator
+n/-n Specifies the value that used in arithmetic calculation

Arithmetic operation can be performed with numeric fields and decimal constants (+n and -n) using the operators MIN (minimum), MAX (maximum), DIV (division), MUL(Multiplication), MOD (modulus), ADD (addition) and SUB (subtraction).

Theorder of assessment precedence for the operators specified below.

  1. MIN and MAX
  2. MUL, DIV and MOD
  3. ADD and SUB

The result of an arithmetic operation is a 15-digit ZD value.

The result of an arithmetic operation can beconverted to a different numeric format, or edited using pre-defined edit masks or user-defined edit masks.


Example: - Will update soon


DFSORT OUTREC: Editing numeric fields DFSORT OUTREC: Date Operations

Advertisements