View previous topic :: View next topic
|
Author |
Message |
deb_parthas
New User
Joined: 24 Nov 2005 Posts: 18
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
deb_parthas
New User
Joined: 24 Nov 2005 Posts: 18
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
|