Home The Company Publications Products Links Tips Jobs


By Jim Poole, seen on SAG-L

Last update: 1 November 2007


Should I also use DSREUSE=NO, when I defined ISNREUSE=YES


Having ISNREUSE turned on means that when you add a record the new ISN (besides explicitly assigning it with an N2 command), could be at the end, could be earlier, could be anywhere.

You have information in the File Control Block (FCB): TOPISN - Highest existing ISN (actually the first unused ISN, but not Important for understanding and decisions) MAXISN - Highest ISN available depending on the AC allocation (extents, etc). 8 slots - contains 8 free ISN's (more later) Rotating ISN ptr - Where the reuseISN process last ended.

Note that by toggling ISNREUSE on/off, you can reset the pointer back to the start of the file. (This would have helped, not solved, Lance's email, read on).

The process:

  1. Add a record.
  2. Can one of the 8 free ISN's be used in the FCB? If so use it, end of process.
  3. If not scan from the rotating ptr to the end of the current AC block. If a slot/ISN is free, then use it. (while you're here, try to replenish the 8 isn's in the FCB up to the end Of the AC block, reset the rotating ptr to where you end up)
  4. If you cannot find an ISN in the 8 slots in the FCB nor in the current AC Block, use TOPISN + 1. The next Add will start in the next AC block.

So, there is a rotating ptr moving forward thru the AC block, being moved each time you do an ADD; you search a little while and if you don't find a slot, go to the end of the file; and let the next ADD start where you left off.

If you are in an ADD, no-delete, situation, then ISN Reuse is inefficient: it is the potential reading of an AC block (no 8 in the FCB) and the scan of the AC block. Also, if you did some ancient concept where the ISN indicates the sequence with which the records are added, then you may want to have ISNREUSE=NO.

In a sick way, I have seen a method where Records were deleted and re-added to maximize the use of all the empty slots (when we had the 16.7M record limit on files); but hopefully, all are files are set to 4byte ISN's long before that becomes a problem.

For more information please see ADABAS Documentation

Top Page

Back to ADABAS Tips, Tricks, Techniques -- Overview