View previous topic :: View next topic
|
Author |
Message |
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Hi,
I have a program at my shop, which is moving low values to a group variable.
Declaration
Code: |
TEMP-MAP EXTERNAL.
05 TEMP-MAP-ENTRY OCCURS 3000 TIMES
INDEXED BY TEMP-IX.
10 TEMP-START PIC S9(4) COMP.
10 TEMP-LNGTH PIC S9(4) COMP.
10 TEMP-FIRST-SUBFLD INDEX.
|
Now its moving
Code: |
MOVE LOW-VALUES TO TEMP-MAP
|
I in my strobe report its taking 19% of the total CPU time and its occurrence of this move is just once , I would like to know is there any alternative apart from this move which can result in less CPU consumption. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why do you believe this is a concern?
If a process does almost nothing (very few instructions executed), a "big move" might be the most cpu intensive. . . 20% of very little is still very little.
If done millions of times, it may be a long-running process, each iteration may not be significant. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
If this MOVE statement is executed only once, I find it difficult to believe that it is 19% of the total CPU usage of the entire program. Are you sure about those statistics? |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
HI Terry,Dick
The program in which this code is been executed in a called pgm, the occurance of the such move is once but for every call its been executed,
I would like to know that is there any other way by which I can implement the same logic by doing some thing else apart from moving low values |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
10 TEMP-FIRST-SUBFLD INDEX. why do you need to define an index?
this is an EXTERNAL data item, so other modules have access.
if each time you enter the CALLed module you need to INITIALIZE the 'table',
why not make it an ODO and just INITIALIZE the counter? |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Quote: |
why not make it an ODO and just INITIALIZE the counter? |
Hi Dick,
i am not able to understand this point, could you please explain me this? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
make the table an OccursDependingOn
or simply use a counter.
I never initialize a table.
I use a counter to control the number of active items,
and populate a new item with the data that needs to be stored.
using the counter, I know which items are active - and have been properly populated. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Just curious - what code does this generate? It should be generating a single MVCL instruction but it could be generating a loop initializing each value separately. I agree that it may not need to be initialized at all because if the counters are used correctly, you'll never read old data, but it would be interesting to see how it is done. Maybe you could redefine a large single variable X(24000) or whatever the length is over the whole table and set that to low-values |
|
Back to top |
|
|
|