Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File sorting and summing up values at specific location

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kenshin

New User


Joined: 02 Aug 2014
Posts: 16
Location: Saint Paul , USA

PostPosted: Wed Sep 23, 2015 2:14 am    Post subject: File sorting and summing up values at specific location
Reply with quote

Hi All ,

I need your help in achieving following results.

Input file:
A 10
A 20
A 30
B 05
B 10
C 30

Output file:
A 60
B 15
C 30
Total 105

can the total be added by adding trailer ?
could anyone help me out with this?
[/code]
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Wed Sep 23, 2015 3:36 am    Post subject: Reply to: File sorting and summing up values at specific location
Reply with quote

Yes, OUTFIL reporting features. REMOVECC, TRAILER1 with TOT(AL), TRAILER3 with SECTIONS for your key, and TOT again.
Back to top
View user's profile Send private message
kenshin

New User


Joined: 02 Aug 2014
Posts: 16
Location: Saint Paul , USA

PostPosted: Wed Sep 23, 2015 5:14 am    Post subject:
Reply with quote

Thank you for quick response ,Bill

I will try adding the keywords you mentioned in my sort card and will share my results.

Thanks
Sumedh
Back to top
View user's profile Send private message
kenshin

New User


Joined: 02 Aug 2014
Posts: 16
Location: Saint Paul , USA

PostPosted: Sat Sep 26, 2015 9:29 am    Post subject:
Reply with quote

It worked !!

SORT FIELDS=(56,2,CH,A,2,6,CH,A)
SUM FIELDS=(59,7,ZD)
OUTREC OVERLAY=(59:59,7,ZD,EDIT=(IIIIIIT))
OUTFIL FNAMES=SORTOUT,REMOVECC,
TRAILER1=(22:'TOTAL HOMESAVER RECORDS
TOT=(59,7,UFF,EDIT=(IIIIIIT)))


Thanks Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us