Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

SYNCSORT :: RE: Consolidating and summing file contents

$
0
0
Author: sergeyken
Posted: Thu Aug 11, 2016 6:05 pm (GMT 5.5)

Abid Hasan wrote:
Hello Kevin,

A simple method can be (assuming LRECL=80); tested on DFSORT, should work with SyncSORT too:
Quote:

OMIT COND=(1,1,CH,EQ,C'9')
. . . . . . . . .
OUTFILE REMOVECC,
BUILD=(1,80),
TRAILER1=(C'9 ',COUNT-1=(M11,LENGTH=9))


Two details.

1) The requirements was: "last record needs to have the sum of the values that are represented in those records".

Parameter TRAILER calculates the total number of type-1 records (that is 6 in this example), while it needs to summarize all the field values from type-9 records (that is 000000003+000000001+000000002=000000006).

2) Statement OMIT just eliminates all type-9 records on input; so there is nothing to summarize from type-9 as required.


Viewing all articles
Browse latest Browse all 9405

Trending Articles