how to convert an ARRAY into Linklist.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: how to convert an ARRAY into Linklist.

Postby BillyBoyo » Fri Apr 19, 2013 2:13 pm

You can't just think of another way of representing an "array" and then just hope its use is going to be faster.

From the key that you have specified and the ODO, it looks like you are using SEARCH ALL? Is this so?

You have defined your data poorly. WST-TXT-MX-COUNT is a USAGE DISPLAY field. If you make it BINARY it will save some instructions. Same for WST-TXT-MX-MAX. You have an INDEXED BY, but without a USAGE INDEX field containing the maximum value, you will again be generating more instructions than necessary.

If you show how the "array" is loaded, how it is "searched" and how data is taken from it, including all relevant data definitions, in the Code tags, then we can probably chop off some CPU usage.

If you want to do a "linked list" which is optimised for a binary search, then you'd have to be more sure of your coding than your data definitions so far may indicate. If you use one which is unoptimised for a binary search, then your CPU use is going to increase considerably.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post