MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sum values in a column using DFSORT or Syncsort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Fri Oct 31, 2008 8:25 pm    Post subject: Sum values in a column using DFSORT or Syncsort Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12394
Topics: 75
Location: San Jose

PostPosted: Fri Oct 31, 2008 11:51 pm    Post subject: Reply with quote

tcurrier,

Please search before posting.

http://www.mvsforums.com/helpboards/viewtopic.php?t=10173&highlight=uff

http://www.mvsforums.com/helpboards/viewtopic.php?t=7264&highlight=uff
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sun Nov 02, 2008 10:29 am    Post subject: File-Aid solution please Reply with quote

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
View user's profile Send private message Send e-mail
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Sun Nov 02, 2008 12:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12394
Topics: 75
Location: San Jose

PostPosted: Mon Nov 03, 2008 12:17 am    Post subject: Reply with quote

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

Code:

    1                                 
   15                                 
  300                                 
 4100                                 
   50


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Mon Nov 03, 2008 6:43 am    Post subject: Reply with quote

Thank you tcurrier.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group