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

SUM using DFSORT


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

New User


Joined: 20 Sep 2005
Posts: 25

PostPosted: Tue Mar 08, 2016 4:49 pm
Reply with quote

Hi - I've the following file in the following format, I want to add my amount when ever there is change the number. Number starting from 45 length 18 chars and amount starting from 75 length 8.

Code:
----+----5----+----6----+----7----+----8----
000000111111111111 PLN                58.01
000000111111111111 PLN               100.02
000000111111111111 PLN               100.41
000000222222222222 PLN                58.01
000000222222222222 PLN            1,2200.02
000000222222222222 PLN                12.00
000000333333333333 PLN                20.00
000000333333333333 PLN                40.00
000000333333333333 PLN                16.00
000000444444444444 PLN            2,3351.29
000000444444444444 PLN               220.04
000000444444444444 PLN               300.05
000000555555555555 PLN               200.03
000000555555555555 PLN               220.04
000000666666666666 PLN                86.93
000000666666666666 PLN                21.79


Code'd
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: Tue Mar 08, 2016 5:08 pm
Reply with quote

And what problem are you having? From your sample data, your file is in sequence already, so how are you thinking of using SUM?

You need to temporarily extend your records in INREC to contain a numeric representation of your value, and then use OUTFIL reporting featuers, REMOVECC, NODETAIL, and SECTIONS (for your key) with TRAILER3 using TOT/TOTAL.

You seem to have a regular number of decimal places, so you just need a data-format which will remove the non-numeric characters for you, converting to PD, for instance.

For your output, it looks like you'll need an EDIT, as you'll want the commas and actual decimal-points.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 08, 2016 8:31 pm
Reply with quote

Thse commas in the thousands look a bit funny - shouldn't 1,2200.02 be 12,200.02 etc?
And where do you want these totals - on change of key or at the end or as running totals on each record?
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Wed Mar 09, 2016 12:15 pm
Reply with quote

Ballaswaroop,

Do you want detail records along with individual trailers when key changes or only trailers are needed? Please provide sample output. That would help.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top