Now I have to count the numbersold by each Levnumber.
So like this Levnumber 1 Totalsold 300
The results are output for a new file.
How can I do this???
First ensure that your file is in order by Levnumber, then read each record.
Accumulate the totals. Only produce an output when the Levnumber changes.
And don't forget to reset your totals to zero after each output.
--
George E. Zielinski
georgez...@retired.airforce.net
=== Air Force Blue ===
=== I Worked for YOU!! ===
Klaas Berend wrote in message <7vmg39$bf7$1...@news.concepts.nl>...
Klaas Berend wrote:
>
> This is my problem.
> I have a file called result1.seq In this file you can find the following
> information.
> Levnumber ArtId Numbersold
> 1 01 100
> 1 02 200
> 2 03 150
> 2 04 300
> 3 05 100
> 3 06 50
>
> Now I have to count the numbersold by each Levnumber.
> So like this Levnumber 1 Totalsold 300
> The results are output for a new file.
> How can I do this???
Klaas,
You are going to have to show some source, (that you have done some of
your homework), before you are likely to get any help on this one.
verstaant u ?
Jimmy, Calgary AB
Something like
SORT FIELDS=(1,1,ZD,A)
SUM FIELDS=(4,3,ZD)
OUTREC=(1,1, Levnumber
4,3) Numbersold
Klaas Berend <kbp...@concepts.nl> wrote in message
news:7vmg39$bf7$1...@news.concepts.nl...
Stephen J Spiro
In article <802scm$f68$1...@nntp1.atl.mindspring.net>,
Sent via Deja.com http://www.deja.com/
Before you buy.
NOTE: it wasn't MY idea to do the sort & sum. I wanted to pre-process, to
trim records
and strip zero records, to cut to around 7 Gig.
<stephen...@my-deja.com> wrote in message
news:8072ef$9nc$1...@nnrp1.deja.com...
Stephen J Spiro
President, Wizard Systems
John
> For more fun:
> Take a look at the options available for Y2K sorting in SYNCSORT
> (DFSORT has them too). I.e., you identify a field as a Year and it
> will sort '00' after '99', based on a window (which can be floating or
> fixed).
With DFSORT, you can identify either complete date fields (e.g.
C'yymmdd', P'dddyy', etc) or year fields (e.g. C'yy', P'yy', etc) to be
sorted, merged, compared or transformed using a century window. For
complete details, see the following URL:
http://www.storage.ibm.com/software/sort/srtmy2p.htm
Frank Yaeger - DFSORT Team
DFSORT is on the Web at URL:
http://www.ibm.com/storage/dfsort/
<fya...@vnet.ibm.com> wrote in message news:80eodb$u51$1...@nnrp1.deja.com...