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

Summarizing Amount Field and Splitting into multiple records


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

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Fri Aug 10, 2012 1:00 pm
Reply with quote

The requirement -

3 fields in Input File:

Code:
Branch                          Acount No                Amount
(PIC 9(5) COMP-3)               PIC 9(10) COMP-3         PIC S9(3) COMP-3
The amount field could have Debit and Credit amounts for any/all account and branch transaction. Need to summarise the amount field on a Branch and Account combination(makes a Key). If the summarised amount exceeds or equals a Million Dollar for a branch-account combination, write a new row. E.g, if the summarised amount is +3500000, there should be 4 rows with amounts 999999,999999, 999999 and 500003 in each row.

How to accomplish the same in a single or multiple sort steps using DFSORT?
Let me know if any further information.

Thanks,
Partha

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: Fri Aug 10, 2012 1:04 pm
Reply with quote

Have you looked at the reporting functions available with OUTFIL? Link to manuals in this forum and top-of-the-page on the site.
Back to top
View user's profile Send private message
deb_parthas

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Fri Aug 10, 2012 2:56 pm
Reply with quote

Doesnt OUTFIL splits file into multiple files? However, in this case, it is required to insert new lines/records in the same Dataset if the amout is more than a certain value.
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: Fri Aug 10, 2012 4:45 pm
Reply with quote

Is that your full considered view after reading the manuals? Or just what you think?

OUTFIL can service your requirement, including generating extra records. Look at /, the "slash operator".
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Aug 10, 2012 10:42 pm
Reply with quote

deb_parthas,


You are summing a 2 byte PD field and you are expecting the total to be in millions. How do you plan to accommodate 999,999 in a 2 byte PD field? You would need at least 4 bytes to store a value of 999,999.

What happens if the summed total gets over 100 million? Do you plan to split the record into 100 records? With Slash operator (/) you can split a single record , but then you need to check how many Slash operators you need for each record.

Also tell us the complete DCB information of both INPUT and OUTPUT files. DCB includes the LRECL and RECFM.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top