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




On Mon, 7 Feb 2005, Forbes, Vincent wrote:

Hi Vincent,

Columns
- Branch & within each
o Income
o Capital
o Market
o Count

Rows
- Acc Control
- Currency
- Acc Type


If I'm reading your example correctly, acc control, currency and acc type are actually columns, not rows! Though, it's awfully hard to tell, since the spacing of your columns is all out of whack in the e-mail message, and the headings and data both linewrapped... creating an awful mess.

But, the way I read it, you want something like this:

AccCtl  CCY  Type  BR10 Inc  BR10 Cap  BR10 Mkt  BR10 Cnt . . . BRxx Cnt
------ ---- ----- ---------  --------  --------  --------       --------
ETA     CDN   A0      1.00       2.00      3.45        4            xxxx
IPS     USA   10      2.22       3.33      4.44        5            xxxx


Where the columns can increase up to 50 different branches, and each branch has a "Inc", "Cap", "Mkt" and "Cnt" column.


I don't really know what the different rows represent... but obviously in my example, AccCtl, CCY and Type are all columns, not rows!

If I'm correct, then this is how I'd code that... this is basically what you've already got, except I didn't see the need for the separate "Key" data structure, and I like to use constants for the maximum number of lines on the report, and branches in the array, so that I won't have to code it again later:

     D MAX_LINES       c                   const(200)
     D MAX_BRANCHES    c                   const(50)

     D branch_t        ds                  qualified
     D   Inc                         13P 2 inz
     D   Cap                         13P 2 inz
     D   Mkt                         13P 2 inz
     D   Cnt                          9P 0 inz

     D Line            ds                  qualified
     D                                     dim(MAX_LINES)
     D   Ctl                          3A
     D   CCY                          3A
     D   Type                         2A
     D   branch                            likeds(branch_t)
     D                                     inz(*likeds)
     D                                     dim(MAX_BRANCHES)

Now to load data into these fields, you'd want to do something like this:

     /free

          for lineno = 1 to MAXLINES;

              Line(lineno).Ctl  = AccCtl;
              Line(lineno).Ccy  = Currency;
              Line(lineno).Type = AcctType;

              for br = 1 to MAXBRANCHES;

                   Line(lineno).branch(br).Inc = Income;
                   Line(lineno).branch(br).Cap = Capital;
                   Line(lineno).branch(br).Mkt = Market;
                   Line(lineno).branch(br).Cnt = Count;

              endfor;
          endfor;

     /end-free

Of course, I don't really know what the logic would be to read the files that contain the various fields that you need to load, since I don't know anything about your database layout. Hopefully you can adapt the code above to load things as appropriate.

Good Luck


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.