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
 

 

Need to Rewrite Program for Improved Performance

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

New User


Joined: 10 Mar 2005
Posts: 16

PostPosted: Thu May 17, 2007 1:26 pm    Post subject: Need to Rewrite Program for Improved Performance
Reply with quote

Hi,

I have this program:

MOVE 'VALUE1' TO SEARCH-TEXT

PERFORM SEARCH-VALUE

IF SW-TEXT-FOUND
MOVE TXT-DESC TO FLD-DESCRIPT
ELSE
MOVE SEARCH-TEXT TO FLD-DESCRIPT
END-IF


MOVE 'VALUE2' TO SEARCH-TEXT

PERFORM SEARCH-VALUE

IF SW-TEXT-FOUND
MOVE TXT-DESC TO FLD-DESCRIPT
ELSE
MOVE SEARCH-TEXT TO FLD-DESCRIPT
END-IF


I have around 10-12 successive codes like this. The SEARCH-VALUE paragraph uses binary search (SEARCH ALL).


How can I rewrite this code to improve performance?
Back to top
View user's profile Send private message

ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Thu May 17, 2007 5:02 pm    Post subject:
Reply with quote

Can u explain ur requriment more details with the Input File,


For example the Input File and compare File both key is ascending order, Then we can aovid both search option it ll help to reduce more time since u r using two times search option for single record.

Thanks...
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Tue May 22, 2007 10:56 pm    Post subject:
Reply with quote

Binary search is very fast. As Ramfrom says, hard to suggest optimizations without knowing more info.

Why have you concluded that your logic is too slow? I would suggest that you review this conclusion. Are you sure these searches are your problem?
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 23, 2007 12:12 am    Post subject:
Reply with quote

Hello,

You mention value1, value2 and so forth for 10-12 values. Might any of these values be the same as a previous value in the same set of values?

If the answer is yes, you might group your values and not re-do the search for duplicates - whatever was found or not found will persist for the particular iteration.

As was posted previously, if you more completely describe your process we may be able to offer better suggestions. Also, please clarify what measurement determined this runs too slow.
Back to top
View user's profile Send private message
niteshsurana

New User


Joined: 27 Oct 2006
Posts: 4
Location: india

PostPosted: Thu May 24, 2007 11:56 am    Post subject:
Reply with quote

In case you have a number of values you can always try the option for a Table use and then search accordingly. This would reduce the overhead for the rest 11 searches.
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 CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts BC, BCR, BRC, BRCL performance steve-myers PL/I & Assembler 0 Fri Dec 23, 2016 7:44 am


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