View previous topic :: View next topic
|
Author |
Message |
Balamurugan Sivalingam
New User
Joined: 24 May 2010 Posts: 4 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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????? |
|
Back to top |
|
|
Balamurugan Sivalingam
New User
Joined: 24 May 2010 Posts: 4 Location: Chennai
|
|
|
|
Am really sorry about posting it under JCLS....
I haven't checked it before posting it....
Regret for the confusion. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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...
PS. I just had a talk with my brother-in-Law, He is a Lawyer, you know. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Anuj Dhawan wrote: |
Your honor, with all regards, i'd like to move this topic to "Mainframe COBOL" part of the Forum...
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
LOL - Thank you Sir.., topic resides in COBOL part of the Forum now. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|