On 8/11/2014 7:43 PM, Sam Siegel wrote:
Don't.

Use occurs depending on or keep track of number of entries in a separate
variable.

Populate entries as needed.   All valid entrIes are initialized when
populated.

Restrict subsequent operations to number of rows in table.

Well, of course, we don't really know what the OP wanted. In terms
of performance, you want to code a VALUE clause on each elementary
item. This results in the whole table being initialized (assuming
COBOL 4.2 (I think) or later) in the load module / program object
so the table is initialized at the time the program is loaded.

Of course, all the entries will be the same. So what was the OP after?

An advantage of doing this also allows you to re-initialize the table
with the INITIALIZE verb.

But, of course, maybe the data the OP wants to put into the table
is from an external file or data base. We don't really know.

-Steve Comstock


On Aug 11, 2014 6:37 PM, "Ron Thomas" <ron5...@gmail.com> wrote:

Hello.

We have a array like this , what would be best way to initlaize this array
  in terms of performance ?

01  EXAMPLE-TABLE.
     05  MY-TABLE.
         10  TABLE-ENTRY OCCURS 9999 TIMES.
             15  FIRST-NAME         PIC X(15).
             15  LAST-NAME          PIC X(15).
             15  SEX-CODE           PIC X.
             15  DOB.
                 20  DOB-YYYY       PIC 9(4).
                 20  DOB-MM         PIC 99.
                 20  DOB-DD         PIC 99.
             15  SSN                PIC 9(9).
             15  SALARY             PIC S9(9)V99 COMP-3.

Thanks
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to