View previous topic :: View next topic |
Author |
Message |
kishore_gk Beginner
Joined: 23 Jul 2003 Posts: 12 Topics: 8
|
Posted: Fri Jan 23, 2004 6:30 am Post subject: Total value of all records in Sort |
|
|
Hi All,
Pls suggest me some thing to acheive the folloinwg..
I want to add certain numbers in a file and display the total at the end of fiie by using SORT utility.
Ex:
Input file :
1
2
3
4
5
Output File:
1
2
3
4
5
15 (This is total of the numbers)
Thank you _________________ kishore |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Jan 23, 2004 6:49 am Post subject: |
|
|
kishore,
The following JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1
2
3
4
5
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
TRAILER1=('TOTAL OF ALL NUMBERS:',TOTAL=(1,1,ZD,M10),80:X)
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
chandra Beginner
Joined: 26 Sep 2003 Posts: 130 Topics: 36
|
Posted: Fri Jun 11, 2004 5:01 am Post subject: |
|
|
Hi Kolusu,
I tried to add the Decimal values by using syncsort but it's giving S0C7. _________________ Regards,
Chandra |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|