Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tables ????

0 views
Skip to first unread message

Klaas Berend

unread,
Nov 2, 1999, 3:00:00 AM11/2/99
to
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???

George E. Zielinski

unread,
Nov 2, 1999, 3:00:00 AM11/2/99
to
This looks like a homework assignment, so I will attempt to give you a
pointer in the right direction rather than work it out for you.

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>...

Howard Brazee

unread,
Nov 2, 1999, 3:00:00 AM11/2/99
to
Now that's how such a question should be answered! IMHO

James J. Gavan

unread,
Nov 2, 1999, 3:00:00 AM11/2/99
to

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

Unbeliever

unread,
Nov 6, 1999, 3:00:00 AM11/6/99
to
Try (Sync)SORTSUM instead of COBOL.

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...@my-deja.com

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
An excellent BUSINESS solution, but I'm sure his teacher will not give
him credit unless it is COBOL!

Stephen J Spiro

In article <802scm$f68$1...@nntp1.atl.mindspring.net>,


Sent via Deja.com http://www.deja.com/
Before you buy.

Unbeliever

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
True - this solution originally came up when I was trying to speed up a
weekly
job, sorting & summing a 30Gig file on an 3090.

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...@my-deja.com

unread,
Nov 9, 1999, 3:00:00 AM11/9/99
to
In article <8082vf$afa$1...@nntp4.atl.mindspring.net>,

"Unbeliever" <pops...@ix.netcom.com> wrote:
> True - this solution originally came up when I was trying to speed up
a
> weekly
> job, sorting & summing a 30Gig file on an 3090.
>
> 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...
> > An excellent BUSINESS solution, but I'm sure his teacher will not
give
> > him credit unless it is COBOL!
> >
> > Stephen J Spiro
I think SyncSort (and by now, maybe DFSORT) will allow you to select
and edit input records, too, to reduce the size of the sorted file. It
has been a while since I used SyncSort like this; most shops don't
want consultants to do it, because their own people can't maintain it.

Stephen J Spiro
President, Wizard Systems

Unbeliever

unread,
Nov 9, 1999, 3:00:00 AM11/9/99
to

<stephen...@my-deja.com> wrote in message
news:80a877$lda$1...@nnrp1.deja.com...

> In article <8082vf$afa$1...@nntp4.atl.mindspring.net>,
> "Unbeliever" <pops...@ix.netcom.com> wrote:
> > True - this solution originally came up when I was trying to speed up
> a
> > weekly
> > job, sorting & summing a 30Gig file on an 3090.
> >
<SNIP> > >

> > > Stephen J Spiro
> I think SyncSort (and by now, maybe DFSORT) will allow you to select
> and edit input records, too, to reduce the size of the sorted file. It
> has been a while since I used SyncSort like this; most shops don't
> want consultants to do it, because their own people can't maintain it.
>
> Stephen J Spiro
> President, Wizard Systems
>
Yepp - I routinely now use INREC & OUTREC.
Last week I had to change a program to increase field sizes in a file.
I also ran synchsort on the existing GDG. I used OUTREC= along
with statements to slice & dice the input record, inserting hex LVs
before each expanded field. I love doing this with MVS utils, because
it's far safer, doesn't require as much coding time as Cobol, runs
faster, and requires no real maintenance, if you want to keep it!

john_m...@my-deja.com

unread,
Nov 10, 1999, 3:00:00 AM11/10/99
to

> <SNIP> > >

> > >
> Yepp - I routinely now use INREC & OUTREC.
>
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).

John

fya...@vnet.ibm.com

unread,
Nov 11, 1999, 3:00:00 AM11/11/99
to
In article <80c55p$19q$1...@nnrp1.deja.com>,
john_m...@my-deja.com wrote:

> 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/

Unbeliever

unread,
Nov 11, 1999, 3:00:00 AM11/11/99
to
Yepp - we've been coding CENTWIN in Syncsort at Amex for a while now,
with a 60/40 floating window. Seems to work well too!

<fya...@vnet.ibm.com> wrote in message news:80eodb$u51$1...@nnrp1.deja.com...

stephen...@my-deja.com

unread,
Nov 12, 1999, 3:00:00 AM11/12/99
to
In article <80ae76$efv$1...@nntp5.atl.mindspring.net>,

"Unbeliever" <pops...@ix.netcom.com> wrote:
>
> <stephen...@my-deja.com> wrote in message
> news:80a877$lda$1...@nnrp1.deja.com...
> > In article <8082vf$afa$1...@nntp4.atl.mindspring.net>,
> > "Unbeliever" <pops...@ix.netcom.com> wrote:
> > > True - this solution originally came up when I was trying to
speed up
> > a
> > > weekly
> > > job, sorting & summing a 30Gig file on an 3090.
> > >
> <SNIP> > >
> > > > Stephen J Spiro
> > I think SyncSort (and by now, maybe DFSORT) will allow you to select
> > and edit input records, too, to reduce the size of the sorted
file. It
> > has been a while since I used SyncSort like this; most shops don't
> > want consultants to do it, because their own people can't maintain
it.
> >
> > Stephen J Spiro
> > President, Wizard Systems
> >
> Yepp - I routinely now use INREC & OUTREC.
> Last week I had to change a program to increase field sizes in a file.
> I also ran synchsort on the existing GDG. I used OUTREC= along
> with statements to slice & dice the input record, inserting hex LVs
> before each expanded field. I love doing this with MVS utils, because
> it's far safer, doesn't require as much coding time as Cobol, runs
> faster, and requires no real maintenance, if you want to keep it!
>
PLEASE comment your code! If it DOES ever require maintenance, it's a
bitch if there are no notes... That's the advantage of well-written
COBOL. If there are multiple edits, under different circumstances...
sheesh!
0 new messages