MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Easytrieve Multidimensional array

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
gildan2020
Beginner


Joined: 07 Dec 2006
Posts: 17
Topics: 8

PostPosted: Wed Feb 25, 2015 9:22 pm    Post subject: Easytrieve Multidimensional array Reply with quote

Hi,

I am trying to create a multidimensional array in Easytrieve.

The COBOL version would look like this:
Code:

01 TABLE.
   05 TABLE-LVL1                          OCCURS 4 TIMES INDEXED BY IDX-1.
      10 TABLE-LVL2                       OCCURS 4 TIMES INDEXED BY IDX-2.
         15 TABLE-LVL3                    OCCURS 3 TIMES INDEXED BY IDX-3.
            20 TABLE-LVL4                 OCCURS 3 TIMES INDEXED BY IDX-4.
               25 TABLE-LVL5              OCCURS 3 TIMES INDEXED BY IDX-5.
                  30 TABLE-LVL6           OCCURS 3 TIMES INDEXED BY IDX-6.
                     35 TABLE-LVL7        OCCURS 2 TIMES INDEXED BY IDX-7.
                        40 TABLE-LVL8     OCCURS 7 TIMES INDEXED BY IDX-8.
                           45 COUNTER PIC 9.


Am I defining the array correctly in Easytrieve? I am not sure whether I have put the number for OCCURS as well as the length for each array correctly.
Code:
DEFINE TABLE          W               1 N,      +
                      OCCURS 18144           
DEFINE TABLE-LVL1     TABLE        2592 A,      +
                      OCCURS 7               
DEFINE TABLE-LVL2     TABLE-LVL1   1296 A,      +
                      OCCURS 2               
DEFINE TABLE-LVL3     TABLE-LVL2    432 A,      +
                      OCCURS 3               
DEFINE TABLE-LVL4     TABLE-LVL3    144 A,      +
                      OCCURS 3               
DEFINE TABLE-LVL5     TABLE-LVL4     48 A,      +
                      OCCURS 3               
DEFINE TABLE-LVL6     TABLE-LVL5     16 A,      +
                      OCCURS 3               
DEFINE TABLE-LVL7     TABLE-LVL6      4 A,      +
                      OCCURS 4               
DEFINE COUNTER        TABLE-LVL7      1 N       
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Thu Feb 26, 2015 8:05 am    Post subject: Reply with quote

You COBOL is not valid (too many OCCURS, outer-most plus six nested is the maximum in Enterprise COBOL).

Your Easytrieve Plus definition will not do what you are hoping. I think the easiest way for this is to define COUNTER (pretty meaningless name) OCCURS 18144 and calculate the subscript. Forget the rest of the definition.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group