MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

disadvantage of initialize..........

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
kishorebodipati
Beginner


Joined: 08 Apr 2004
Posts: 15
Topics: 9
Location: Chennai

PostPosted: Thu Apr 15, 2004 5:04 am    Post subject: disadvantage of initialize.......... Reply with quote

Dear all,

What was the disadvantage of INITIALIZE in COBOL?

Regards,
Kishore
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Apr 15, 2004 5:51 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kishorebodipati
Beginner


Joined: 08 Apr 2004
Posts: 15
Topics: 9
Location: Chennai

PostPosted: Thu Apr 15, 2004 7:02 am    Post subject: Reply with quote

Hi Kolusu,

Thanks for your Detailed clarification.

Kishore Bodipati.
Back to top
View user's profile Send private message Send e-mail
kok328
Beginner


Joined: 05 Nov 2003
Posts: 19
Topics: 0
Location: MI, USA

PostPosted: Wed Apr 21, 2004 6:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group