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