I can't solve a problem using DFSORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

I can't solve a problem using DFSORT

Postby javivi » Wed Sep 12, 2012 5:26 pm

Hi
I have a problem that i can’t solve with DFSORT but I hope it possible to solve with DFSORT.

I have a file with the input money and output money from an account and I need to match each output with each input. The rules to match a output with a input are:
1.- Look for an input with a date less than the output.
2.- If the input money is >= than the output money , the match finish and the output money is subtracted from the input money.
3.- If the input money is < than the output money, subtract the input money from the output money and look for another input.

Example file:
KEY          INPUT/OUTPUT  MONEY   
------------ ------------- ------
A 2010-01-01   input       +40
A 2010-03-02   input       +80
A 2011-04-06   input       +100
A 2012-01-03   output      -110
A 2012-02-05   output      -10
A 2012-05-03   output      -12
A 2012-06-09   input       +50


I need to obtain the next file :
KEY          INPUT/OUTPUT  MONEY   
------------ ------------- ------
A 2010-01-01   input       +0
A 2010-03-02   input       +0
A 2011-04-06   input       +82
A 2012-01-03   output      -110
A 2012-02-05   output      -10
A 2012-05-03   output      -12
A 2012-06-09   input       +50


Explanation

The first output with 110 matches with the first input of 40 and let the input with 0, but in the output remain 70 not matched against any input. Then search for other Input and find the second input with 80, subtract 70 from 80 and leave de second input with 10. The first output now is fully matched.
The second output with 10 use the second input, and leave the second input with 0 and the second output is fully matched.
The third output with 12 matches with the third input and let the input with 82 and the third output is fully matched.

There is any interested to help me?

Thanks.

Code'd
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: I can't solve a problem using DFSORT

Postby NicC » Wed Sep 12, 2012 6:21 pm

Read it twice - still all gobbledy-gook to me. Is your first file supposed to be for SORTIN and the second for SORTOUT? If so, still does not make sense.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: I can't solve a problem using DFSORT

Postby BillyBoyo » Wed Sep 12, 2012 6:55 pm

Why don't you just set some of the "input"s to zero and some to amounts smaller than they started with.

Without looking at the original input, no-one can have any idea that anything is wrong.

Of course, I'm not really suggesting you do this. I'm pointing out that the "design" is deeply flawed. Such that the above is true.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: I can't solve a problem using DFSORT

Postby enrico-sorichetti » Wed Sep 12, 2012 6:58 pm

I can't solve a problem using DFSORT

stupid title,
the only reasonable reply is how bad

I wonder why the TS requested a solution for the "amount against multiple invoices" problem
using a dsfort solution, instead writing a program to provide a properly audited track of the computations

see anyway for example ...
http://ibmmainframes.com/about58190.html
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: I can't solve a problem using DFSORT

Postby dick scherrer » Wed Sep 12, 2012 8:46 pm

Hello,

This sounds very much like an Accounts Receivable cash application situation.

Because there many things going in most (every one i've seen) cash application processes, i do not believe it should be done tieh the sort or any other utility. Cash application becomes rather complex and usually refers to vsam or database data as part of the process.

I suspect this came to the sort part of the forum to get away from having to develop the process. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post