|
Vincent, I just figured out last week how to do this last week. I am not sure this is the best/correct way, but it worked for me. This is how I set up a 3 dimension 'array' . (3 year by 70 qtys by 52 weeks) The 'secret' is defining each subfield in the 'parent' data structure using the 'likeds' keyword. All the data structures are 'qualified' Declarations: ========== * Quantities for 52 weeks D Qty4Wk Ds Qualified D Qty 6S 0 D Dim(52) D Inz * Quantities for 99 lengths D Qty4Lg Ds Qualified D Qty4Wk LikeDs(Qty4Wk) D Dim(70) D Inz(*LikeDs) * Quantities for 3 years D Qty4Yr Ds Qualified D Qty4Lg LikeDs(Qty4Lg) D Inz(*LikeDs) D Dim(3) Referenced in calcs like: Qty4Yr.Qty4Lg(Yr#).Qty4Wk(Lg#).Qty(Wk#) = Qty; HTH Tim Kredlo Exterior Wood, Inc -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Forbes, Vincent Sent: Monday, February 07, 2005 12:33 PM To: 'RPG programming on the AS400 / iSeries' Subject: How do I set up a two dimensional array? My users want me to create a summary extract of account values. I am trying to define a two dimensional array which has as: Columns - Branch & within each o Income o Capital o Market o Count Rows - Acc Control - Currency - Acc Type It would look something like this. Acc Ctl CCY Acc Typ Br10 Inc Br10 Cap Br10 Mkt Br10 Count Br11 Inc Br11 Cap Br11 Mkt Br11 Count Br20 Inc Br20 Cap Br20 Mkt Br20 Count ETA CDN A0 1.00 2.00 3.45 4 6.60 5.55 6.66 6 6.22 5.66 66.66 6 IPS USA 10 2.22 3.33 4.44 5 5.22 5.66 8.88 8 202.22 2.20 3.33 4 PPS EUR 2B 9.99 8.88 7.07 7 6.66 5.55 4.44 3 3.33 2.22 1.11 1 This is what I have so far. D Br 2S 0 Dim(50) * D Key DS D Ctl 3A D CCY 3A D Typ 2A * D Data DS D Inc 13P 2 D Cap 13P 2 D Mkt 13P 2 D Cnt 9S 0 * D Array DS Qualified Dim(200) D Row LikeDS(Key) D Col LikeDS(Data) Dim(50) \Vincent -- 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-2025 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.