× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi All,

I have a scenario like this
I have 3 files , File1, File2, File3.

File1 has account number as a filed
File2 has account number, security and Quantity as fields
File3 has Account number Quantity and Security.

suppose File1 has these values
A
B
C

File2 - Accnum and Sec are keyfileds
Accnum Security Qty
A x 2
A x 3
A x 1
A y 2
A y 3
B y 5
B y 1
C x 2
C x 2

I want to create File3 as a summary. The value should be like this

AccNum Security Qty
A x 6
A y 5
B y 6
C x 4

Without using SQL(I have to change the whole program logic if I go for SQL)
By using chain or Reade how can I achieve this in mininum steps

I have used a method like this
Point to the first record in file1 and read from there onwards. With Accnum
as the key readE file2 in a loop( the file has accnum and security as
keufields but am using Accnum alone not sure whether that will cause any
probs) , save the previous security value and in the DoW not
%Eof(File2)loop check whether the prev saved security = Current security,
If so sum up the Qty fields, else, write to file3. After endDo, I put the
write part again otherwise I was missing the last record which will not
enter into the DoW not %Eof loop.

Anyone has any better idea? My logic seems to be complex.. :(

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.