On Mon, 23 Aug 2010 09:51:42 -0500, Ward, Mike S <[email protected]> wrote:
>I'm not trying to be funny, but would an indexed vsam file be a plausible solution? Use the 4-byte code as the index. > >-----Original Message----- >From: IBM Mainframe Assembler List [mailto:ASSEMBLER- [email protected]] On Behalf Of Patrick Roehl >Sent: Monday, August 23, 2010 9:46 AM >To: [email protected] >Subject: Efficient Memory List > >I'm looking for advice on how to handle a potentially large list of data. >The list is comprised of 4-byte entries and the application needs to know >if an incoming item is already present or is new to the list. This is the >approach that is currently in use and that I'd like to improve upon: > >1) Perform a binary search and process no further if the item is already >present > >2) If there is not enough room to add a new entry, allocate a new storage >area 1.5 times the size of the old area, MVCL the existing data to the new >area, and free the old area. > >3) The binary search from step 1 indicates where the new entry should be >inserted. To add the entry to the list, individual entries are moved one >at a time (to avoid overlapping moves) to open a spot in the list for the >new entry. > >This old process has worked well for fairly small lists but I'd like >opinions on how to improve this process for large lists (say, a million or >more). > >Using SORT is not an option because of the multi-threaded online >environment (it's not running in CICS). > >The list is only used by a single process that handles data as it >arrives. To process correctly, it must be able to determine immediately >if the data being presented has already been processed. When all of the >incoming data for that process has been handled the list is discarded. > >Speed and efficiency are important. All suggestions regarding logic and >coding techniques are appreciated! That would work great if I were allowed to perform I/O. My post had a type in that it should have said "It's NOT running in CICS." (Corrected above - sorry about the error in the posting.)
