View previous topic :: View next topic |
Author |
Message |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Mon May 11, 2009 2:34 pm Post subject: Replacing Initialization of Arrays |
|
|
Hi,
I have this complex array in a cobol program:
Code: |
01 WS-COMP-TBL.
03 WS-COMP-TBL-DETAIL OCCURS 800 TIMES.
05.....
05.....
05.....
05.....
05.....
05 WS-COMP-TBL-FIELDS OCCURS 300 TIMES.
15...
15...
15...
15...
15...
15...
15...
15...
|
In the program , the WS-COMP-TBL-FIELDS is being initialized for all the employees in the every dept.
Note : Using ODO is not an option here since the getting the count of employees is not viable
Is there a way to INITIALIZE the array?
Thanks,
Martin |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Mon May 11, 2009 2:54 pm Post subject: |
|
|
But the MOVE statement has to be execuetd for all the employees and doesnt really help in reducing the CPU time right.. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon May 11, 2009 3:04 pm Post subject: |
|
|
Martin,
how about looking up the INITIALIZE function in the COBOL Manual.
or you could generate 800 X 300 data entry items with value clauses, then redefine them with the table definition, then everything would be initialized at load time.
IF you are soooo concerned with CPU time, then use a counter and only initialize those items you use, as you populate them.
If you are going to be doing SEARCHes (serial, obviously) you will save time by having a counter. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon May 11, 2009 3:06 pm Post subject: |
|
|
Quote: | Note : Using ODO is not an option here since the getting the count of employees is not viable |
that is not the reason you use an ODO. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon May 11, 2009 3:35 pm Post subject: |
|
|
Martin wrote: | But the MOVE statement has to be execuetd for all the employees and doesnt really help in reducing the CPU time right.. |
says who? Trust me that move statement would out perfom INITIALIZE statement
I have seen a Perform Varying scoring over INITIALIZE function |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
|
Back to top |
|
 |
|
|