| View previous topic :: View next topic |
| Author |
Message |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Fri Oct 31, 2008 8:25 pm Post subject: Sum values in a column using DFSORT or Syncsort |
|
|
Hello,
I'd like to sum the values in a certain column in a file. I know I
can do it in FILEAID using the TALLY ACCUM function, but I'm drawing
a blank on how to do it in Syncsort or DFSORT/ICETOOL. The numeric
field could have leading spaces. Example below:
(periods are actually spaces)
| Code: |
...1
..15
.300
4100
..50 |
(Total to be displayed: 4,466)
Thanks for any help. |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12394 Topics: 75 Location: San Jose
|
|
| Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Sun Nov 02, 2008 10:29 am Post subject: File-Aid solution please |
|
|
Hi, tcurrier.
Would you please post the File-Aid solution here.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
| Back to top |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Sun Nov 02, 2008 12:03 pm Post subject: |
|
|
Leading periods are actually spaces :
(Anyone know if there's a way to preserve the leading spaces when displaying them in this forum?)
| Code: | //STEP1 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//DD01 DD *
....1
...15
..300
.4100
...50
/*
//SYSIN DD *
$$DD01 TALLY ACCUM=(1,5,C,'Total : ')
/*
//
FOLLOWING TOTALS DEVELOPED FROM
H2501T4.H2501T4T.JOB38913.D0000101.? VOL=SYSOUT
Total : -------------------------------------------------------4466 |
|
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12394 Topics: 75 Location: San Jose
|
Posted: Mon Nov 03, 2008 12:17 am Post subject: |
|
|
| tcurrier wrote: | | (Anyone know if there's a way to preserve the leading spaces when displaying them in this forum?) |
tcurrier,
You can preserve the leading spaces by enclosing them in code blocks
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Mon Nov 03, 2008 6:43 am Post subject: |
|
|
Thank you tcurrier. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
| Back to top |
|
 |
|
|
|