SORT JCL to SUM up values

SORT JCL to SUM up values If you wish to sum up the values at a particular position sorted at some value then you can use the following sort card The following card will sum values (lets assume salaries) appearing at pos 7th (4 bytes) grouped/sorted on data (emp numbers) at 37th position of 10bytes. SORT FIELDS=(37,10,CH,A),STOPAFT=10 Example JCL is provided below. ; ; ; ; //SORTIN   DD DISP=SHR,DSN=USERID.ABC.INPFILE, //SORTOUT  DD DSN=USERID.ABC.OUTFILE, //      SPACE=(TRK,(30,10),RLSE),                                 //      DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)                //SORTWK01 DD  UNIT=DISK,SPACE=(CYL,(20,5),RLSE)                  //SORTWK02 DD  UNIT=DISK,SPACE=(CYL,(20,5),RLSE)      //SORTWK03 DD  UNIT=DISK,SPACE=(CYL,(20,5),RLSE)      SORT FIELDS=(37,10,CH,A),STOPAFT=10