Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Alternative for Initialize

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Balamurugan Sivalingam

New User


Joined: 24 May 2010
Posts: 4
Location: Chennai

PostPosted: Wed May 26, 2010 2:08 pm    Post subject: Alternative for Initialize
Reply with quote

Hi,

Is there any other way than specifying INITIALIZE keyword for initialization?

Normal at the time of initialization (using INITIALIZE) the resource/space usage will be very high which may affect the performance of the code.

Please suggest me.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed May 26, 2010 2:49 pm    Post subject:
Reply with quote

Can you please explain the reason why you think that this is a JCL related topic ?

Please say where you think this topic should have been posted and one of the moderators will move it.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 26, 2010 2:50 pm    Post subject:
Reply with quote

Quote:
Normal at the time of initialization (using INITIALIZE) the resource/space usage will be very high which may affect the performance of the code.

Who says this? manuals????? icon_eek.gif
Back to top
View user's profile Send private message
Balamurugan Sivalingam

New User


Joined: 24 May 2010
Posts: 4
Location: Chennai

PostPosted: Wed May 26, 2010 4:07 pm    Post subject:
Reply with quote

Am really sorry about posting it under JCLS....

I haven't checked it before posting it....

Regret for the confusion.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed May 26, 2010 4:14 pm    Post subject:
Reply with quote

The initialize statement can consume a lot of CPU, if not used carefully. For CICS, (though it's not my cup of tea, but till the chapters I read), on the other hand, I'd say it is wise to ensure that variables are actually not set or modified before you reference the contents, unless you want to use information that could have been set by an earlier invocation.

For batch-processes, if you are using the INITIALIZE statement for each input, output record - I'd say STOP. This might tunn up as a real CPU burner. The more complex the copybook you are initializing, the worse it is. Sugest you look into using INITIALIZE only once per record format, move the initialized record to a WS-some-HOLD-variable area the same size as the copybook, then whenever you need to do an initialization of the record copy the 01 level of WS-some-HOLD-variable to the 01 level of the copybook.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed May 26, 2010 4:21 pm    Post subject:
Reply with quote

expat wrote:
Can you please explain the reason why you think that this is a JCL related topic ?

Please say where you think this topic should have been posted and one of the moderators will move it.
Your honor, with all regards, i'd like to move this topic to "Mainframe COBOL" part of the Forum..icon_smile.gif.

PS. I just had a talk with my brother-in-Law, He is a Lawyer, you know.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed May 26, 2010 4:54 pm    Post subject:
Reply with quote

Anuj Dhawan wrote:
Your honor, with all regards, i'd like to move this topic to "Mainframe COBOL" part of the Forum..icon_smile.gif.

PS. I just had a talk with my brother-in-Law, He is a Lawyer, you know.

Mr. Dhawan, after consultation with my daughter, also a lawyer, your motion to move this topic is accepted.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed May 26, 2010 4:59 pm    Post subject:
Reply with quote

LOL - Thank you Sir..icon_smile.gif, topic resides in COBOL part of the Forum now.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed May 26, 2010 5:48 pm    Post subject: Reply to: Alternative for Initialize
Reply with quote

If at all possible, (for example), define all like-defined WS variables under a given group, then you can clear these variables with a single MOVE statement.

Code:

01  WS-BINARY-GROUP BINARY.
    03  WS-BINARY-01 PIC S9(09).
    03  WS-BINARY-02 PIC S9(18).
    03  WS-BINARY-03 PIC S9(04).
    03  WS-BINARY-04 PIC  9(09).
01  WS-NUMERIC-GROUP.
    03  WS-NUMERIC-01 PIC 9(09).
    03  WS-NUMERIC-02 PIC 9(17).
    03  WS-NUMERIC-03 PIC 9(11).
01  WS-ALPHA-GROUP.
    03  WS-ALPHA-01 PIC X(128).
    03  WS-ALPHA-02 PIC X(128).
    03  WS-ALPHA-03 PIC X(128).
*
MOVE LOW-VALUES TO WS-BINARY-GROUP.
MOVE ZEROS      TO WS-NUMERIC-GROUP.
MOVE SPACES     TO WS-ALPHA-GROUP.

However, INITIALIZE maybe your only method for signed packed-decimal, unsigned (neutral) packed-decimal and signed display-numeric.

YMMV....

Bill
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed May 26, 2010 9:11 pm    Post subject:
Reply with quote

Hello,

If your area to be initialized contains a variety of data types, you might consider having an "initialization set" of the fields defined in the code. Other than the group field name, the others could be FILLER and never be referenced in the code. These would contain the initial value for each field. A single move would "initialize" multiple fields rather than the field-by-field MOVEs done by the INITIALIZE.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Alternative to CALL tso command jerryte TSO/ISPF 6 Fri Aug 29, 2014 12:06 am
No new posts Need to Initialize an empty flat file... ksouren007 DFSORT/ICETOOL 9 Fri Sep 27, 2013 6:57 pm
No new posts How to initialize address location in... Pavankumar.m COBOL Programming 2 Thu Sep 05, 2013 12:58 pm
No new posts INITIALIZE Table - Alphanumeric &... mrgnndhmk COBOL Programming 11 Tue Jul 16, 2013 11:36 pm
No new posts AMODE 64 C system() alternative Eric Olson All Other Mainframe Topics 2 Tue May 21, 2013 8:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us