On 7/30/2013 2:46 PM, Farley, Peter x23353 wrote:
Steve,

Just a side question, not related to the original thread -- How do you teach
COBOL programmers when (or even if) to use INITIALIZE? I ask because I have
found that the code generated by INITIALIZE is extraordinarily inefficient. I
have often just removed it from anyplace that is in any kind of loop and also
from any frequently called common subroutines and managed to achieve quite a bit
of CPU savings as a result.

I found that MOVE SPACES (or LOW-VALUES, your choice) to
01-level-structure-name and then if/as needed separately initializing numeric
fields that will be referenced was far more efficient than initializing an
entire heterogeneous structure. Of course, doing an INITIALIZE only once in a
run unit won't hurt performance in the least, and might save trouble later, so I
do not say never to INITIALIZE. I just say never in loops or subroutines that
get called many times (FSVO "many").

For large-index-value but relatively simple element type tables there is
alsothe (relatively) new ability to specify VALUE clauses for table elements. 
I've
not investigated the efficiency of using this new feature.

Actually, you can specify VALUE on table elements since COBOL II Rel 3 or 4.
I haven't done any experiments on performance for this feature.


Just curious about your thoughts and teaching on this.

Peter

Pretty much as you mention: here it is; there are better (more
efficient) ways to do this (group moves, as you suggest), but
there are times it is a nice tool to have, especially in
initializing tables that have value clauses in their declare.

-Steve


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Steve Comstock
Sent: Tuesday, July 30, 2013 3:57 PM
To: [email protected]
Subject: Re: COBOL ? - emulating recursive PERFORM statement

<Snipped>

Also, the easy stuff gets adopted early and more widely:

scope terminators
evaluate
larger tables
initialize
LE storage management
LE dates
but not so much LE condition handling

etc.

--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to