Page 1 of 1

Simple Array Help

PostPosted: Wed Jun 16, 2010 7:40 pm
by nadecian
Hello can someone please help me learn arrays for my work.

My in-file has many records with the same acct# but different book-ids (one acct# can purchase many books)

My boss asked me to create a program where I show a single acct# with multiple book-ids on the same record (to help show buying trends from a single acct#)

sample output
(ACCT#)            BOOK-ID1            BOOK-ID2          BOOK-ID3   ETC.... Up to 20 purchases
75643334          ACTION123         ACTION222         SPORT222



Does anyone have some sample code I can work from as the easytrieve manual doesnt show anything.

thanks for your time,
N.

Re: Simple Array Help

PostPosted: Wed Jun 16, 2010 11:56 pm
by dick scherrer
Hello and welcome to the forum,

Before you can code, you need to determine the rules.

One of particular importance is the maximum book-id's for an acct. . . What is to be done where there are too many to fit on one line?

If the input data is sorted by acct and book-id it is a straightforwrd process. If the data is not already sorted in this sequence, a subset of the file containing the acct/biook-id could be sorted for use as input.