<jeff@[EMAIL PROTECTED]
> wrote in message
news:1156164608.427833.305850@[EMAIL PROTECTED]
>I have a program that I wrote that creates a work file to read from to
> create a print record. The program is a sales re****t that allows the
> user to specify how many years to compare. An example is 07-01-06 thru
> 07-31-06 If they answer 3 prior years it would show sales data (it also
> handles exact day instead of just 070106, 071005, 070104)
> 20060701
> 20050702
> 20040703
>
> 20060702
> 20050703
> 20040704
>
> When I read the Work file I need to read 2 recs before writing the
> print record to calculate the percentage change in amount. Example:
> 20060701 10%
> 20050702 7%
> 20040703
> Sales up 10% for 2006 over 2005, sales up 7% 2005 over 2004.
>
> Any ideas on the best way to accomplish this?
>
A thoroughly odd requirement.
Is your proposed re****t format supposed to be columns of years showing
actual and %-differential sales and lines of days? This would show a lot
of
meaningless data. Comparing sales on any one day with sales 52/104/156...
weeks earlier could be done, but wouldn't seem to give you any real data.
So
many things can happen to influence the sales on any one day (like
weather)
that comparing doesn't seem to make sense.
What is the format of your intermediate file? Is it indexed on date, for
instance? It it organised by product?
It wouldn't seem too much of a burden to read even 10 years of data - more
would be difficult to fit on a re****t-page - at 365 records per year,
that's
only 3,650 records.
I'd simply read all of the data in and place it into an array in
working-storage. Then simply grab it back out of the array to print it -
but
your specification isn't really that clear.


|