|
I don't think you can dimension a 'traditional' array that way. There are other arrays, playing tricks with %alloc or some such animal. However, I get the impression that is one feature the compiler developers wish they could take back. Do you even need to look at the detail information? I take it this isn't some simple report or you wouldn't even need arrays, just print at control break time. Would a SQL GROUP BY with a fetch loop work? Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com CarollaT@xxxxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 04/14/2004 03:45 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To rpg400-l@xxxxxxxxxxxx cc Subject Data Structure array/Lookup questions I am creating a module whose goal is to summarize around 200k records (current month) from a file with around 13mil records, into company totals (around 64 groups). To save time, I have written an LF sorted by date, descending, and as I iterate through the file, as soon as I reach a date before the current month, the loop concludes. During this iteration, I would like to summarize each record into a data structure array (around 64 elements), with one element for each company. This will avoid iteration through a summary file of the 200k records. The questions I have (which I was going to save for the Chicago RPGWorld, but I can't wait) are as follows: First of all, can I somehow DIM the data structure array based on the number of records in the company file? This way, if we add companies, I won't have to modify and re-compile. Also, I won't have to make a guess-timate of around 150, and dimension unneeded elements. Then, if the array elements contain a 3-alpha and a 11,2-packed field, can I use the %Lookup BIF to lookup the 3-alpha identifier for each company as I am summarizing? Will the other data structure field interfere with this? Tony Carolla MedAmerica Billing Services, Inc. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.