Page 1 of 1

Sum the integer based on fields at different positions

PostPosted: Tue Oct 25, 2016 10:27 am
by Papya013
Hi All,

I have an input file with two records in which ORDER1, STORE1 AND 12345 are the common keys for both the records.

INPUT FILE

INREC1 12345 00000 ORDER1 STORE1 12
INREC2 23797 12345 ORDER1 STORE1 14


I am expecting the addition to happen if the key fields mentioned above matches.

OUTPUT FILE

INREC2 23797 12345 ORDER1 STORE1 26


Could you please suggest on how I can achieve this ?

Re: Sum the integer based on fields at different positions

PostPosted: Tue Oct 25, 2016 10:56 am
by BillyBoyo
OUTFIL reporting features, with NODETAIL,REMOVECC and SECTIONS specifying the keys and TRAILER3 to produce the output using TOT/TOTAL for the summed fields, alongside the rest of the data.