Posted: Wed Oct 22, 2008 12:22 pm Post subject: sum records with same group and form total of all groups
I have a file with many records which are having department and salary values as below:
Code:
ABC 10
DEF 5
ABC 20
PQR 54
PQR 12
PQR -90
I want the output in the format as below where in for each department values should be added up and finally also the total should be summed up
Code:
ABC 30
DEF 5
PQR -24
---
TOT: 11
And i want another output in the format which should should display as below only for DEF & PQR the positive value should come in PLUS and negative value should come in MINUS and finally all the values should be added up and i do not want to do anything with ABC.Hope i am clear in my question.Basically i want two reports .
Code:
PLUS MINUS
ABC 30
DEF 5 5
PQR -24 -24
--- ---- -----
TOT: 11 5 -24
Thanks a lot for your reply and It works fine for me. Can you help me with a simple solution which will give the output for report 1 only , what should i take out from your code:
I have a file with many records which are having department and salary values as below:
Code:
ABC 10
DEF 5
ABC 20
PQR 54
PQR 12
PQR -90
I want the output in the format as below where in for each department values should be added up and finally also the total should be summed up
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Wed Oct 22, 2008 1:55 pm Post subject:
Did you read the reply and understand it? Look at the OUTFIL FNAMES= lines _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum