Hello list,

say I have a file with goods, dates, and available quantities, not necessarily 
sorted. I want to sort it and calculate daily deltas. 

For example using the following input :

Product,Date,Availability
Sugar,2022/08/01,100
Sugar,2022/08/02,97
Sugar,2022/08/03,93

I need to get to this:

Product,Date,Sold
Sugar,2022/08/01,N/A  (No daily delta for the first record)
Sugar,2022/08/02,3    (100 - 97)
Sugar,2022/08/03,4    (97 - 93)

May I use bultin DFSORT functions to calculate deltas from the previous record 
and the current one? 

I had a look at the OUTREC statement in the Application Programming Manual, but 
as far as I can see arithmetic expressions can only use input fields from the 
current record or decimal constants.

It believe I can achieve the above result using an E35 exit, just wanted to be 
sure that's the only way.

Thanks!
mario

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to