IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

sum and count


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Mon Oct 07, 2013 9:19 pm
Reply with quote

I have input ( positions is as in sample) :
Code:
AA    10                 
AA    10                 
BB    30                 
AA    10                 
AA    20                 
BB    10                 
CC    10                 


the output should be sum and count :
Code:
AA    50  04       
BB    40  02       
cc    10  01       


Could you please help
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 07, 2013 9:48 pm
Reply with quote

SORT on the key.

Use OUTFIL with NODETAIL,REMOVECC with SECTIONS for the key and TRAILER2 with TOT and COUNT.
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Mon Oct 07, 2013 10:09 pm
Reply with quote

ok, I'll try ... not success so far ( positions are different from sample):
Code:
           SORT FIELDS=(1,6,CH,A)               
           OUTFIL REMOVECC,NODETAIL,           
           SECTIONS=(1,6,                       
           TRAILER2=(1,8,                       
           $                                   
ICE223A 0 REPORT FIELD ERROR                   
           TOT=(562,8,PD,M3),COUNT))           
           $                                   
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Mon Oct 07, 2013 10:11 pm
Reply with quote

before Frank was retired, he just post tested solution... I've missed Frank
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 07, 2013 10:25 pm
Reply with quote

Sorry, the 2 and 3 are close together on my keyboard. Try with TRAILER3 for SECTIONS.
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Mon Oct 07, 2013 10:39 pm
Reply with quote

thank you ... I will try ... I just need counter - thanks for the secsion idea
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Mon Oct 07, 2013 11:03 pm
Reply with quote

worked - thank you
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top