Hi All,
I am a new user to IBM Mainframe user group. I am also new to the SYNCSORT utility. I would really appreciate if anybody in the group can provide some guidance/advise for the below situation.
I have to create an O/P file with the sorted/data.
The input file contains Region code, Area code and the sales amount for the region.
I have to sort the file the sum up the sales amount on a area code basis. My O/P file should contain the Area code, the summed up sales amount for the area and the number of records (count) sorted in area level. The sales amount is in the packed decimal format.
Ex:
Input file
AREA1 REGION1 100.00
AREA3 REGION1 400.00
AREA2 REGION2 100.00
AREA3 REGION1 300.00
AREA1 REGION2 200.00
AREA3 REGION1 100.00
I am using OUTREC option to display only the required data in the O/P file
The sort card that I have used is,
SORT FIELDS=(1,5,CH,A,6,7,CH,A)
SUM FILEDS=(15,6,PD) - sales data is in the packed decimal format
OUTREC FIELDS=(1:1,5,1X,15,6,COUNT)
The required O/P is (Area code, the Summed up sales amount, and the number of records that belongs to that area code). I used the COUNT parameter in the SORT card. But I got message that it an invalid parameter for SYNCSORT
The required O/P file (after SORT) is as follows:
AREA1 300.00 2
AREA2 100.00 1
AREA3 800.00 3
I would really appreciate if anybody in the group can suggest the SORT card (for SYNCSORT) to achieve this requirement.
Thanks
Mat