SORT – SUM FIELDS
//SORTIT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=USERID.SORT.INPUT,DISP=SHR
//SORTOUT DD DSN= USERID.SORT.OUTPUT,
//SORTWK01 DD UNIT=WORK,SPACE=(CYL,(5,1))
//SORTWK02 DD UNIT=WORK,SPACE=(CYL,(5,1))
//SYSIN DD *
//* END OF JOB
Note: The SUM control statement deletes records with equal control fields and optionally summarizes specified numeric fields on those records. If numeric fields are to be summarized, the data in the summary fields is added, the sum is placed in one of the records, and the other record is deleted. Provided arithmetic overflow does not occur, the SUM statement produces only one record per sort key in the output data set.
XSUM means the deleted records are to be written to the data set defined by the SORTXSUM DD statement.
In United States, If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog
You may also like to look at:
|Working on Mainframes – Is Change to a different technology necessary|