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
 

 

SUM using DFSORT

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

New User


Joined: 20 Sep 2005
Posts: 24

PostPosted: Tue Mar 08, 2016 4:49 pm    Post subject: SUM using DFSORT
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Tue Mar 08, 2016 5:08 pm    Post subject: Reply to: SUM using DFSORT
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: 1713
Location: UK

PostPosted: Tue Mar 08, 2016 8:31 pm    Post subject:
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: 114
Location: Hyderabad

PostPosted: Wed Mar 09, 2016 12:15 pm    Post subject:
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    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 How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts DFSORT to match two files and write John F Dutcher DFSORT/ICETOOL 6 Thu May 12, 2016 5:17 pm


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