Another place INITIALIZE for complex structures or arrays should be
avoided is in CICS transaction code -- doesn't have to be in a loop or
subroutine to have an impact if it is in code that services a
transaction that has a high daily count.
Joel C Ewing
On 07/30/2013 03: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 also
> the (relatively) new ability to specify VALUE clauses for table elements.
> I've not investigated the efficiency of using this new feature.
>
> Just curious about your thoughts and teaching on this.
>
> Peter
>
> -----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.
>
> --
...
--
Joel C. Ewing, Bentonville, AR [email protected]
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN