View previous topic :: View next topic |
Author |
Message |
kishorebodipati Beginner
Joined: 08 Apr 2004 Posts: 15 Topics: 9 Location: Chennai
|
Posted: Thu Apr 15, 2004 5:04 am Post subject: disadvantage of initialize.......... |
|
|
Dear all,
What was the disadvantage of INITIALIZE in COBOL?
Regards,
Kishore |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Apr 15, 2004 5:51 am Post subject: |
|
|
kishorebodipati,
when you use an INITIALIZE statement at the group level, cobol converts it into series of move statements at fields level. The INITIALIZE statement sets selected categories of data fields to predetermined values. It is functionally equivalent to one or more MOVE
statements. If you are using it repeatedly for over a million times there should be decrease of performance.
It does not make any difference if you are using initialize for individual items.on ther hand it is easier to maintain.
In order to speed it up initialize is, first you can Initialize the 01 level record one time at the beginning of the program and move it to it to another 01 level variable. Now every time you want to initialize move the saved 01 level to the 01 level variable.
Hope this helps...
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
kishorebodipati Beginner
Joined: 08 Apr 2004 Posts: 15 Topics: 9 Location: Chennai
|
Posted: Thu Apr 15, 2004 7:02 am Post subject: |
|
|
Hi Kolusu,
Thanks for your Detailed clarification.
Kishore Bodipati. |
|
Back to top |
|
|
kok328 Beginner
Joined: 05 Nov 2003 Posts: 19 Topics: 0 Location: MI, USA
|
Posted: Wed Apr 21, 2004 6:16 pm Post subject: |
|
|
As I recall, alphanumeric fields are set to spaces and numeric fields are set to low-values. If you plan to send the file with FTP or IND$FILE download, the low-values will screw up the transmission. |
|
Back to top |
|
|
|
|