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

SYNCSORT :: Consolidating and summing file contents

$
0
0
Author: Kevin Lindsley
Subject: Consolidating and summing file contents
Posted: Thu Jun 09, 2016 5:24 am (GMT 5.5)

My input file has the following format with multiple records starting with 0, 1 and 9. Input data below:

Code:

0       20160607
0       20160607
0       20160607
1xxxxxxx1
1xxxxxxx2
1xxxxxxx3
1xxxxxxx1
1xxxxxxx1
1xxxxxxx2
9       000000003
9       000000001
9       000000002


My desired output file is to have only one of the first three records that start with 0, all of the records that start with 1 and only one of the last three records that start with 9, however that one last record needs to have the sum of the values that are represented in those records. Output data below:

Code:

0       20160607
1xxxxxxx1
1xxxxxxx2
1xxxxxxx3
1xxxxxxx1
1xxxxxxx1
1xxxxxxx2
9       000000006


How would I accomplish this with SYNCSORT? Thanks.


Viewing all articles
Browse latest Browse all 9405

Trending Articles