Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Summarizing Amount Field and Splitting into multiple records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Summarizing Amount Field and Splitting into multiple records
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Aug 10, 2012 1:04 pm    Post subject: Reply to: Summarizing Amount Field and Splitting into multip
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    Post subject: Reply to: Summarizing Amount Field and Splitting into multip
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Aug 10, 2012 4:45 pm    Post subject: Reply to: Summarizing Amount Field and Splitting into multip
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    Post subject:
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us