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
 

 

How this logic increases the performance?

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

New User


Joined: 29 Jun 2006
Posts: 25

PostPosted: Tue Aug 19, 2008 7:51 pm    Post subject: How this logic increases the performance?
Reply with quote

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
View user's profile Send private message

Bill O'Boyle

CICS Moderator


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

PostPosted: Tue Aug 19, 2008 8:01 pm    Post subject: Re: How this logic increases the performance?
Reply with quote

What is the picture clause of array "A" or its elementary items (if any)?

Bill
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Aug 19, 2008 10:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Tue Aug 19, 2008 10:33 pm    Post subject: Re: How this logic increases the performance?
Reply with quote

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
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 BC, BCR, BRC, BRCL performance steve-myers PL/I & Assembler 0 Fri Dec 23, 2016 7:44 am
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What are the way we can improve CPU p... Gunapala CN DB2 10 Mon Oct 24, 2016 2:16 pm
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am


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