| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
sudhakar_mainframe
Joined: 29 Jun 2006
Posts: 7
|
| Posted: Tue Aug 19, 2008 7:51 pm Post subject: How this logic increases the performance? |
|
|
HI,
I have the following logic to initialize the Large arrays in Cobol.
Declaration in WS.
---------------------
05 WS-TEMP.
07 A OCCURS 100 TIMES
Procedure division statements.
-----------------------------------
INITIALIZE A (1)
MOVE WS-TEMP TO WS-TEMP (LENGTH OF A (1) + 1 : )
How this logic increases the performance?...
Thanks,
Sudhakar. |
|
| Back to top |
|
Bill O'Boyle
Joined: 14 Jan 2008
Posts: 345
Location: Orlando, FL, USA
|
| Posted: Tue Aug 19, 2008 8:01 pm Post subject: Re: How this logic increases the performance? |
|
|
What is the picture clause of array "A" or its elementary items (if any)?
Bill |
|
| Back to top |
|
CICS Guy
Joined: 18 Jul 2007
Posts: 1199
Location: At my desk
|
| Posted: Tue Aug 19, 2008 10:18 pm Post subject: |
|
|
An old Assembler trick....(IIRC)
MVI X'40',WS-TEMP
MVC WS-TEMP+1(L'WS-TEMP-1),WS-TEMP
Overlapping move to propagate the first byte to the rest of the field. |
|
| Back to top |
|
Bill O'Boyle
Joined: 14 Jan 2008
Posts: 345
Location: Orlando, FL, USA
|
| Posted: Tue Aug 19, 2008 10:33 pm Post subject: Re: How this logic increases the performance? |
|
|
Guy,
I stopped using initialization-method this once COBOL2 was released. Although, it did work well in OS/VS COBOL.
But in this example, if the array is to be cleared to SPACES, then MOVE SPACES to the 05 level will generate (most likely) an MVCL and hence, 5 instructions to perform this initialization or a series of MVC's (as you've shown).
Also, since COBOL2, a VALUE clause can be used for each elementary item of an array and then the entire array can be cleared in the program Prologue code.
Bill |
|
| Back to top |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|