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:[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 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! ========================== This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.
