IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to Rewrite Program for Improved Performance


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 148
Location: Ottawa Canada

PostPosted: Tue May 22, 2007 10:56 pm
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

Moderator Emeritus


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

PostPosted: Wed May 23, 2007 12:12 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts exploiting Z16 performance PL/I & Assembler 2
Search our Forums:

Back to Top