Highlighted
Absent Member.
Absent Member.
550 views

[archive] Three Dimensional Array processing

[Migrated content. Thread originally posted on 17 April 2008]

I am writing a program to read three indexed files and from them to create a three-dimensional array for later use in creating a screen to navigate along a "Category/sub-category/sub-category" path.

The screen is dispayed with three boxes:
First box contains Category
Second contains Sub-category
Third box contains Sub-sub-category

Navigation:
On entering the primary screen one is presented with a screen with all three boxes populated.

So, when one selects an item from the category list, the listing of sub-categories is displayed, and likewise when an item from the sub-category list is selected, the sub-sub-category list is displayed. From the sub-sub-category any selection will pass control for other processing, with a return to the main screen on exiting from later screens.

Programming:
The Acucobol reference manual suggests it is possible to create a three dimensional table, in fact if one was sufficiently mentally agile one could have upto 15 dimensions - but three dimensions is all I need. Below is a definition of the table:

01 SAVE-SUB-HEADING-TABLE.
03 SHT-IX-SH-MAIN PIC S999 COMP-3.
03 SHT-IX-SH-SUBHED PIC S999 COMP-3.
03 SHT-IX-SH-SBSBHD PIC S999 COMP-3.
03 S-M-T2 OCCURS 20.
05 SAVE-MAIN-ID PIC S9(05) COMP-3.
05 S-S-T2 OCCURS 150.
07 SAVE-SHEAD-IDX PIC S9(05) COMP-3.
07 SAVE-SHEAD-NAME PIC X(20).
07 SAVE-SHEAD-NUM PIC S9(07) COMP-3.
07 SAVE-SHEAD-END PIC S9(07) COMP-3.
07 S-S-S-T OCCURS 100.
09 SAVE-SS-SHEAD-IDX PIC S9999 COMP-3.
09 SAVE-SS-SHEAD-NAME PIC X(20).
09 SAVE-SS-SHEAD-NUM PIC S9(07) COMP-3.
09 SAVE-SS-SHEAD-END PIC S9(07) COMP-3.

When I compile the program, I get the following error message:
"Data item > 64K illegal here"
The manual suggests I ought to be using a 64-bit option, but the compiler sets the relevant compiler option as a default.

I have tried reducing the number of OCCURS, removing the NAME fields so that I am only left with numerics, and finally storing all the numeric fields as COMP-3 fields. Still the message relating to 64K illegality.

Short of buying a whole stack of new PCs withj 64-bit processors, is there anyhing I can do that would enable me to create a three-dimension table?

I am currently trying to create a three-dimension philosophy using two two-dimension tables, but the index pointers are currently not calculating correctly.

Thanks

Geoffrey
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Three Dimensional Array processing

There are 300,000 occurences of S-S-S-T.

The sheer volume of this data would suggest to me that you should look to using a vision indexed work file to organise the data rather than using a memory table. You can then easily and quickly address it as each category is selected and the next level can be populated by reading the relevant index file. We have similar issues where the number of categories is also variable and the user can add more and more - if this is your case also the problem will get worse as the number of categories and sub categories increases.

Keith
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Three Dimensional Array processing

Hi,
1) if you're using a compiler prior v6.0 nor you're using a compatibility option to downgrade your compiler try the -Zl compiling option: this allows data > 64k
2) see chapter 5.1.6 of reference manual for "large data handling"
3) take a look to Keith's suggestion: if you've a lot of data and item's number may exceed your table size maybe useful to use a file to organize them and than use a paged grid to show a buffered portion of them.
Hope this helps, bye Gio
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Three Dimensional Array processing

..why don't you use a tree-view ? You get two big advantages:
1.present a better UI
2.allocate only the memory you need
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.