View previous topic :: View next topic
|
Author |
Message |
sreenigacc
New User
Joined: 16 Oct 2007 Posts: 15 Location: bangalore
|
|
|
|
The requirement is given below.......
I have a file, It has some records with columns department and amount....
department is repeated multiple times... as like this
department amount
100 10
200 10
100 20
300 20
100 20
200 10
100 20
300 30
I need the output like this
department amount
100 70
200 20
300 50
can any one provide the JCL for this.......?
thanks in advance
sreeni |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
You want the sort parms to sum amount by department?
if you would provide the DCB parms for the file and the positions of the FIELDS within the records someone will provide the SORT parms necessary.
Which sort do you have? Syncsort or DFSORT? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Or you could search for examples in the SORT forum. |
|
Back to top |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
100 10
200 10
100 20
300 20
100 20
200 10
100 20
300 30
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,3,CH,A)
OPTION ZDPRINT
SUM FIELDS=(5,2,ZD)
/*
|
|
|
Back to top |
|
|
|