I am trying to sum the prices of a particular book using "SUM". However, I am not getting the SUM... I am getting all the records.
Here are the details
Input file is :
1001 MATHS 200
1002 ENG 250
1002 ENG 235
1002 ENG 215
1002 ENG 250
1002 ENG 235
1002 ENG 215
Expected Output:
1002 ENG 700
Current output :
1002 ENG 250
1002 ENG 235
1002 ENG 215
1002 ENG 235
1002 ENG 215
Code is below :
//STEP2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XYZ.TEST1.ISORT,DISP=SHR
//SORTOUT DD DSN=XYZ.TEST1.OSORT,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(BLKSIZE=8000,LRECL=80,RECFM=FB)
//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
INCLUDE COND=(6,5,CH,EQ,C'ENG ')
SUM FIELDS=(12,4,BI)
/*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XYZ.TEST1.ISORT,DISP=SHR
//SORTOUT DD DSN=XYZ.TEST1.OSORT,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(BLKSIZE=8000,LRECL=80,RECFM=FB)
//SYSIN DD *
SORT FIELDS=(1,4,CH,A)
INCLUDE COND=(6,5,CH,EQ,C'ENG ')
SUM FIELDS=(12,4,BI)
/*
I am using Z/OS DFSORT V1R5.
Can anyone please help me?