Mainframe - Copy one file to another file with sorted order and summed up the column

Command :
SORT FIELDS=(starting position, length, format of the variable, ascending or descending.
SUM FIELDS=(starting position, length of the variable, format of the variable)
Example :
//DDName EXEC PGM=SORT
//SORTIN DD DSN=XXXXXXXXXXXXXXXXX,
// DISP=SHR
//SORTOUT DD DSN=XXXXXXXXXXXXXXXXXXXX,
// DISP=(NEW,CATLG,DELETE),
// UNIT=XXXXX,SPACE=(XXX,(XX,XX),XXXX),
// DCB=(*.SORTIN) Output file created using properties from input file.

//SORTWK01 DD UNIT=XXXXX,SPACE=(XXX,(X,X))
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,11,CH,A)
SUM FIELDS=(12,7,ZD) – Zoned decimal
From input file from 1 st position to 11 th position having matching records then it will be added up and one record will be written into output file.