home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / disam.zip / DISAM.DOC < prev    next >
Text File  |  1990-04-20  |  26KB  |  695 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                    DISAM3
  19.  
  20.                   Dynamic Indexed Sequential Access Method
  21.  
  22.                                 Version 3.5
  23.  
  24.                                 Apr. 20, 1990
  25.  
  26.                                 Written by:
  27.                                 Robert Pearce
  28.                                 2326 W. Cabana
  29.                                 Mesa, AZ. 85202
  30.                                 (602) 835-9189
  31.  
  32.  
  33.  
  34.  
  35.                              LICENSE AGREEMENT
  36.  
  37.  
  38.              The author, Robert Pearce, grants you without charge
  39.       the right to reproduce, distribute and use copies of this
  40.       "shareware" version of the DISAM file handler software product
  41.       (including the on disk documentation), on the express condi-
  42.       tion that you do not receive any payment, commercial benefit,
  43.       other consideration for such reproduction or distribution, or
  44.       change this license agreement.
  45.  
  46.              Support from users such as yourself enable the author
  47.       to develop additional features and future versions of the
  48.       DISAM product. Your contribution of $10.00 would be greatly
  49.       appreciated and should be mailed to:
  50.  
  51.              Robert Pearce
  52.              2325 W. Cabana
  53.              Mesa, AZ. 85202
  54.  
  55.              By sending your contribution, along with your  name and
  56.       address you will become a registered user of DISAM and
  57.       eligible to receive technical support, announcements of new
  58.       releases and fixes to problems as they become known.
  59.  
  60.  
  61.              THIS PRODUCT IS LICENSED WITHOUT ANY WARRANTY OF
  62.       MERCHANTABILITY, FITNESS OF PARTICULAR PURPOSE, PERFORMANCE,
  63.       OR OTHERWISE; ALL WARRANTIES ARE DISCLAIMED. BY USING THE
  64.       DISAM PRODUCT, YOU AGREE THAT THE AUTHOR WILL NOT BE LIABLE TO
  65.       YOU OR ANY THIRD PARTY FOR ANY USE OF (OR INABILITY TO USE)
  66.       THIS SOFTWARE, OR FOR ANY DAMAGES WHATSOEVER.
  67.  
  68.              This software was tested as follows:
  69.       DISAM and DFH3 were assembled using Microsoft MASM V5.1.
  70.       User programs are compiled GW-BASICusing Microsoft GW-BASIC
  71.       Compiler V3.2 as sold by Zenith Data Systems and assembler
  72.       programs also assembled using Microsoft MASM V5.1.
  73.  
  74.  
  75.  
  76.  
  77.                                Introduction
  78.  
  79.  
  80.  
  81.              In the beginning, there was punched paper tape and fly
  82.       readers. Records were stored and read sequentially. Then came
  83.       magnetic tape drivers for mass storage but records were still
  84.       stored and read sequentially.
  85.  
  86.              Records were blocked by one and it took 6 seconds to
  87.       read or write them. Then came blocked record formats and many
  88.       records could be gotten for that 6 seconds. I/O was getting
  89.       faster but it was still sequential.
  90.  
  91.              When the diskette came along, sequential access was
  92.       preserved and random access was added. Random access provides
  93.       a way to access a specific record in a file. However, there
  94.       is no intelligence built into the random access file handler
  95.       and records are fixed length.
  96.  
  97.              The main difference between DISAM and Random access is
  98.       the way data is accessed.
  99.  
  100.              Random access, accesses records by relative numbered
  101.       data blocks. Each block is fixed length without regard to how
  102.       much data is stored in them.
  103.  
  104.              DISAM accesses records by an assigned character key.
  105.       Record lengths are variable and can be up to the GWBASIC limit
  106.       of 255 bytes. Records can be longer if DISAM is accessed
  107.       through an assembler or "C" interface.
  108.  
  109.              Random access will read records sequentially in block
  110.       number order.
  111.  
  112.              DISAM access will read records sequentially in
  113.       ascending key order. (0-9,A-Z,a-z)
  114.  
  115.              Random access allows fields to be defined within the
  116.       data block via the FIELD command.
  117.  
  118.              DISAM relies on the user to provide field delimiters
  119.       and a parsing routine. Possible delimiters could be "\", "^",
  120.       or "*" or any other special character not being used as data.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                   DISAM
  127.  
  128.  
  129.              DISAM is a resident file handler initially designed
  130.       for use with GWBASIC. The need for this type of file
  131.       handler arose when ASCII data files were required to be
  132.       accessed by a specific alphanumeric key.
  133.  
  134.              DISAM stores records in key ascending order regardless
  135.       of data entry. The record length is limited by GWBASIC's
  136.       limit of 255 bytes,although DISAM can handle much longer
  137.       records. The size of the file is limited to the amount of free
  138.       space on the recording media.
  139.  
  140.              The record key has a maximum length of 125 bytes and
  141.       can be anywhere within the first 255 bytes of the record. The
  142.       key's position in the record has no affect on the response
  143.       time of the file handler.
  144.  
  145.              Because of the nature of the file handler, there is a
  146.       special utility, DISAM.COM, that is used to define the file.
  147.       There is also a special set of GWBASIC code statements used to
  148.       access the file handler. Other than the above restrictions, a
  149.       DISAM file can be copied, renamed, or deleted through the
  150.       normal MS-DOS commands.
  151.  
  152.              DISAM records can be retrieved either sequentially, by
  153.       full key or by a shortened (generic) key.  You might use a
  154.       generic key to set the position in the file and then read
  155.       sequentially until the generic key changes, or you might read
  156.       a specific record by full key, or just read the entire file
  157.       sequentially. DISAM is designed for all of these.
  158.  
  159.              Adding records to DISAM can be done in any order. The
  160.       file handler will insert them in their proper place. An
  161.       existing record may be replaced with a record of a different
  162.       length. The file handler will make additional room for the
  163.       replaced record or free up the extra space if the new record
  164.       is shorter that the original.
  165.  
  166.              The file handler buffers its data blocks so that if
  167.       records being accessed or added fall within the same block,
  168.       unnecessary I/O is not performed. However if the users
  169.       program should fail, current added records may be lost. To
  170.       provide for additional data integrity, there is an "Immediate"
  171.       mode that can be invoked to force the file handler to write
  172.       the data buffer after each record is added, changed or
  173.       deleted. This is a great help during program development but
  174.       should be used sparingly after the program is completed
  175.       because of the increased time it takes to write the data
  176.       buffers.
  177.  
  178.  
  179.  
  180.  
  181.  
  182.                              Installation
  183.  
  184.              There is no special installation needs for DISAM. The
  185.       module, DFH3.COM, is executed. Its execution will make it
  186.       resident in low memory and set up an entry pointer at 12:0
  187.       Hex. The user has the opportunity at this time to provide
  188.       multiple file access buffers. Based on using the index and
  189.       data block defaults, one file buffer is needed to access each
  190.       DISAM file.  One is provided by default.  If there is to be
  191.       more than one DISAM file open at the same time, a buffer must
  192.       be provided for each file. The limit is 5 DISAM files opened
  193.       at the same time. E.I.  DFH3 3 will provide buffers for three
  194.       DISAM files.
  195.  
  196.              If there is a second attempt to load the file handler
  197.       the user will get a message that it is already loaded. If the
  198.       address, 12:0, is being used by another module, then the user
  199.       will get a message for that also and DISAM cannot be loaded.
  200.       This address is also known as INT 48H and the code uses 5
  201.       bytes. This also includes 1 byte of INT 49H.
  202.  
  203.              More on the DFH3 buffers. The buffers are made up of
  204.       four dynamic parts. Based on the defaults this amounts to
  205.       about 3K per buffer.
  206.  
  207.              128 = File Control Block
  208.              512 = File Index Block
  209.             2048 = File Data Block
  210.              256 = User Add Record Buffer
  211.             ----
  212.             2944 = Default Buffer size
  213.  
  214.              If your file needs more than this you can define more
  215.       buffers. If you do and you need to have more than one DISAM
  216.       file open at the same time then use the odd numbered ones.
  217.       Define 4 buffers and use 1 and 3. This will give you 6K of
  218.       buffer space. If you really need a larger buffer size, you can
  219.       "zap" the space allocation size using PC-ZAP and file
  220.       DFH3.Z03.
  221.  
  222.              The following code is placed in the GWBASIC program.
  223.  
  224.  
  225.       nnn REM Make sure that the file handler is in memory.
  226.       nnn DEF SEG=&H0012       'This sets the segment address
  227.       nnn X=PEEK(&H0)          'Get the code byte at the entry
  228.       nnn DEF SEG              'Restore the data segment to GWBASIC
  229.       nnn IF X<>234 THEN STOP  'Expect to find a long JMP inst.
  230.                                'If it is not, DFH3 is not loaded.
  231.  
  232.  
  233.  
  234.  
  235.       nnn REM Set up variables for file handler calls
  236.       nnn F$="x[,n]"           ' "x" is the file handler command
  237.       nnn R$="y"               ' "y" depends on the command
  238.  
  239.  
  240.  
  241.  
  242.       nnn DEF SEG=&H0012       'Set the segment address
  243.       nnn DFH3=&h0             'Set offset address
  244.  
  245.       nnn CALL ABSOLUTE (F$,R$,DFH3)      'Compiled basic call
  246.  
  247.       nnn CALL DFH3 (F$,R$)           'Interpretive basic call
  248.  
  249.       nnn IF LEN(R$)=1 ....    'Return code from file handler
  250.                                'else R$=data record
  251.  
  252.  
  253.  
  254.  
  255.  
  256.                            COMMANDING DISAM
  257.  
  258.       OPEN
  259.       F$="O[,n]"    (for all programs except Quick-BASIC)
  260.       F$="Q[,n]"    (for Quick-BASIC programs)
  261.       R$="filename.ext"+""
  262.              The open command; opens the file, reads the control
  263.       block, the first index block and the first data block into the
  264.       file handler's buffer. Quick BASIC does not allow the size in
  265.       the string descriptor block to be changed for chaining reasons
  266.       I suppose. If you use the "O" to open a quick BASIC file you
  267.       will get a string corrupt message. The "Q" open sets an
  268.       internal flag to stop the modification of the string length
  269.       being passed back to the calling program. This means that if
  270.       you send 80 bytes to DFH3 your response will be 80 bytes. You
  271.       must test for the first character in a return-code. This is
  272.       for "Q" open only.     e.i nnn IF LEFT$(R$,1)="0" GOTO ...
  273.  
  274.  
  275.  
  276.       RETURN-CODES
  277.              "0" Normal response to the open.
  278.              "5" The file is currently in use by another program and
  279.                  the share option is set to "N". No sharing allowed.
  280.              "7" The file was not found.
  281.              "8" The buffer specified was found in use. This is
  282.                  because it has been opened by another file or the
  283.                  program using the buffer ABENDed leaving it open.
  284.                  Use the FREE command to close the buffer if it was
  285.                  left open by a program ABEND.
  286.              "9" This is a general error usually accompanied by a
  287.                  register dunp and error address.
  288.  
  289.  
  290.       CLOSE
  291.       F$="C[,n]"
  292.       R$=" "
  293.              The close command writes the file buffers if required
  294.       to disk and closes the file to the system.
  295.  
  296.       RETURN-CODES
  297.              "0" Normal response.
  298.              "9" An invalid buffer number was used.
  299.  
  300.  
  301.       ADD
  302.       F$="A[,n]"
  303.       R$="Data record to be added to the DISAM file"
  304.              The add command checks for an existing record of the
  305.       same key. If it is not found, the record is added to the DISAM
  306.       file.
  307.  
  308.       RETURN-CODES
  309.              "0" Normal response.
  310.              "2" Record already exists.
  311.              "4" Record length invalid.The record length must be
  312.                  longer then the key offset plus the key length and
  313.                  shorter than  Data Block Size - 10.
  314.  
  315.  
  316.       DELETE
  317.       F$="D[,n]"
  318.       R$="full-key"
  319.              The delete command requires a full key. Generic deletes
  320.       are not permitted. The delete removes the record and makes
  321.       room in the data block for another record.
  322.  
  323.       RETURN-CODES
  324.              "0" Normal response.
  325.              "1" Record not found.
  326.  
  327.  
  328.  
  329.  
  330.       GET
  331.       F$="G[,n]"
  332.       R$="full-key"+SPACE$(255-keylength)       'Keyed read
  333.       R$="generic-key"+SPACE$(255-keylength)    'generic keyed read
  334.       R$=SPACE$(255)                            'sequential read
  335.              Space must be provided for the record to be inserted
  336.       into the GWBASIC string work space. The file handler will not
  337.       corrupt the basic string space. Only as much space sent to the
  338.       file handler will be used. 255 bytes is the max. for a GWBASIC
  339.       program. The file handler will return a shorter record and
  340.       make the necessary changes to the string descriptor. It will
  341.       not use more space than provided by the calling program.
  342.              Quick-BASIC users, be careful here. You must know how
  343.       long the record is and pass that many bytes to DFH3.
  344.       Return-codes of "1" and "3" will also be "record length" long.
  345.       Be aware of records that start with the above numerics.
  346.  
  347.       RETURN-CODES
  348.              "<------data record------>" Normal response.
  349.              "1" Record not found.
  350.              "3" End of file. (sequential read)
  351.  
  352.       PUT
  353.       F$="P[,n]"
  354.       R$="Existing record that is to be changed"
  355.              The put command searches out the existing record on
  356.       the file. Deletes it and adds the replacement record. This
  357.       way there is no need for the existing and the new record to
  358.       be the same length.
  359.  
  360.       RETURN-CODES
  361.              "0" Normal response.
  362.              "1" Record not found.
  363.              "4" Record length invalid.The record length must be
  364.                  longer then the key offset plus the key length and
  365.                  shorter than Data Block Size - 10.
  366.  
  367.       IMMEDIATE
  368.       F$="I[,n]"
  369.       R$=" "
  370.              The immediate command sets a file handler flag to
  371.       update the data block immediately after each update. This will
  372.       provide maximum file integrity and maximum response time. This
  373.       command is provided to maintain the DISAM file while the
  374.       calling program is being developed and should be removed when
  375.       all program fixes are in place. The flag is reset when the
  376.       file is closed.
  377.  
  378.       RETURN-CODE
  379.              "0" Only response
  380.  
  381.       FREE
  382.       F$="F[,n]"
  383.       R$=" "
  384.              The free command makes the specified buffer available
  385.       for use. This command is provided to free a buffer after a
  386.       program has ABENDed, leaving the file and the buffer open.
  387.  
  388.       RETURN-CODE
  389.              "0" Normal response
  390.  
  391.  
  392.  
  393.  
  394.  
  395.                        THE DISAM UTILITY PROGRAM
  396.  
  397.  
  398.  
  399.              DISAM.COM is the utility program that is used to set up
  400.       a DISAM file. When the program is started the screen will
  401.       display:
  402.  
  403.                     DISAM UTILITY PROGRAM Ver 3.n
  404.                    Written by R. Pearce. dd-mmm-yy
  405.                    Enter Function:
  406.                            CATalog listing of DISAM file statistics
  407.                            DEFine a new DISAM file
  408.                            DELete a file
  409.                            FREe DISAM file handler buffer space
  410.                            LOAd a DISAM file from a sorted source
  411.                            UNLoad all or part of a DISAM file
  412.                            VERify the condition of a DISAM file
  413.                            END
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.             The following defines the functions of DISAM
  421.  
  422.  
  423.  
  424.  
  425.     DEFine:
  426.            This function defines the DISAM file. You will be prompted
  427.     for the file name. A check will be made for an existing DISAM
  428.     file. Then you will be prompted for the key length and the key
  429.     offset.
  430.  
  431.            The key length can be from 1 to 125 characters in length.
  432.  
  433.            The key offset is a place within the record where the key
  434.     starts. The first position in the record is offset 0 (zero).  The
  435.     offset plus the key length will establish the minimum record
  436.     length.
  437.  
  438.            Normally a key length of 11 to 15 characters is adequate
  439.     for most data retrieval.
  440.  
  441.            After the key length and offsets are entered you will be
  442.     prompted to specify the Index Block Size (IBS), or take the
  443.     default of 512 bytes.
  444.  
  445.            The minimum IBS is four times the key length (FKL) plus 4,
  446.     plus eight. IBS = (4*(FKL+4))+8.  If you specify a size smaller,
  447.     DISAM will calculate the minimum size for you.
  448.  
  449.            Next you will be prompted for the Data Block Size (DBS), or
  450.     you may take the default of 2048 bytes.
  451.  
  452.            The minimum size of the DBS is equal to the IBS. The
  453.     maximum size to stay within the buffer default is 2048. This will
  454.     allow you to write a record up to 2038 bytes long. DISAM will
  455.     round up the DBS to the next multiple of the IBS if you specify a
  456.     size that is not a multiple of the IBS.
  457.  
  458.            Next you will be prompted for the load free space in whole
  459.     percentage points. This is the amount of free space to be kept
  460.     available in each data block during the load of the DISAM file.
  461.     At this point you have to know what the DISAM file is going to be
  462.     used for.
  463.  
  464.            If there are no data records to be loaded after the define
  465.     of the DISAM file, then the value is not used and it does not
  466.     matter what you enter. a C/R will provide 0%.  If this is a read
  467.     mostly reference file then you could use 0 - 2 %. If you are going
  468.     to be changing and adding data on a regular basis then 10 to 20
  469.     percent would be good.
  470.  
  471.            The intent is to provide the file growth space before it is
  472.     necessary to split the data blocks. A file load function with 0%
  473.     load free space will pack the records into the smallest space so
  474.     that any record adds will cause the data blocks to be split and
  475.     increase file response time for adds.  Fifty percent load free
  476.     space will cause the load function to double the size of the DISAM
  477.     file. Records added on a random basis will not cause as many block
  478.     splits hence faster file response time. The maximun value is 50%.
  479.  
  480.            Lastly you will be asked if this file may be shared with
  481.     other programs.You must answer "Y" or "N". In such multitasking
  482.     environments as DESQview, several virtual 8086 windows may be
  483.     opened, each running tasks that may include DISAM files. If you
  484.     specify "N" only one program may access a DISAM file at a time. If
  485.     you specify "Y" then no data integraty is insured. Several
  486.     programs can update the same DISAM file, even the same record. It
  487.     is the users responsibility to insure that if "Y" is specified,
  488.     only one program updates and all other programs read the DISAM
  489.     file.
  490.  
  491.            With the file definition complete a CATalog display will be
  492.     presented. Take note of the maximum record length on this display.
  493.     This is the edited value when it comes to adding records.
  494.  
  495.  
  496.  
  497.  
  498.     LOAd:
  499.     The load function loads the DISAM file from sequential file.  A
  500.     program such as QSORT may be used to sort the sequential file
  501.     prior to the load. DISAM expects the input file to be sorted in
  502.     key sequence.
  503.  
  504.            You will be prompted for the sequential file name and the
  505.     DISAM file name.
  506.  
  507.            At the end of the load the number of records loaded will be
  508.     displayed.
  509.  
  510.  
  511.  
  512.  
  513.     UNLoad:
  514.            The unload function copies the DISAM file to a sequential
  515.     file. You will be prompted for the DISAM file name, the sequential
  516.     file name, the number of records to unload (default is ALL), the
  517.     number of records to skip (default is NONE), and the starting
  518.     DISAM record key (default is NONE).  The skip count and the
  519.     starting key are mutually exclusive.  Use one or the other.  Not
  520.     both.
  521.  
  522.            The DISAM file will be unloaded and the unload count will
  523.     be displayed.
  524.  
  525.            The sequential file may also be the printer (PRN)or the
  526.     display (CON).
  527.  
  528.  
  529.  
  530.  
  531.     DELete:
  532.            The delete function allows you to delete a file while using
  533.     the DISAM utility program. Used during repacking of the DISAM
  534.     file.
  535.  
  536.  
  537.  
  538.  
  539.     CATalog:
  540.            The catalog function displays the current information about
  541.     the DISAM file. You will be prompted for the DISAM file name.
  542.     Below is a display of the pertanent information about the DISAM
  543.     file.
  544.  
  545.            1) the key length
  546.            2) the key offset
  547.            3) control block size
  548.            4) index block size
  549.            5) data block size
  550.            6) next available block number
  551.            7) the maximum record length allowed
  552.  
  553.            8) number of index records
  554.               (same as the number of data blocks)
  555.            9) number of index splits
  556.  
  557.           10) number of data records
  558.           11) number of data splits
  559.  
  560.           12) percent free space at load time
  561.           13) the share option
  562.  
  563.  
  564.  
  565.  
  566.     VERify:
  567.            The verify command is used to close files left open by
  568.     program ABENDs. You will be prompted for the DISAM file name.
  569.     Verify will display a message indicating how the file was found
  570.     and the catalog record count. It then will read the file
  571.     sequentially and display the actual record count.
  572.  
  573.            If there is a difference between the two record counts then
  574.     records were lost as a result of the program ABEND. Use the
  575.     "Immediate" command while debuging the program to prevent record
  576.     losses.
  577.  
  578.  
  579.  
  580.  
  581.     FREe:
  582.             The free command frees all 5 of the file handler's
  583.     buffers. This command is useful during program development to
  584.     clean up the buffers used by DFH3 after program ABENDs.
  585.  
  586.  
  587.  
  588.  
  589.  
  590.     THE COMPRESS PROCEDURE
  591.  
  592.            Because of the way the records are added, described above,
  593.     the DISAM must be compressed from time to time. The following is
  594.     the recommended procedure.
  595.  
  596.     run DISAM
  597.            select CAT to get the file key length and offset
  598.                          and the Index and Data buffer sizes.
  599.            select UNL to unload the DISAM file to a seq. file
  600.            select DEL to delete the DISAM file
  601.            select DEF to redefine the DISAM file
  602.            select LOA to reload the DISAM file
  603.            select CAT to verify record counts
  604.            select DEL to delete the seq. file
  605.            select END
  606.  
  607.  
  608.     Note:
  609.            If you are an assembler programmer, there is a sub routine
  610.     included in this package that will allow you to access DISAM from
  611.     the program as easy as:
  612.  
  613.            mov  si,offset datrec    ;point to record key
  614.            call dsmget              ;get the record
  615.  
  616.            datrec db max_rec_len
  617.  
  618.  
  619.     ZAPS......
  620.  
  621.            Zap fixes documented and applied to this product use the
  622.     PC-SIG software "PC-ZAP" located on disk #355. PC-ZAP is available
  623.     at your local authorized PC-SIG dealer.
  624.  
  625.  
  626.  
  627.  
  628.            SYSTEM ERROR messages:
  629.  
  630.            You may get a system error message due to an internal
  631.     error. It will be in the form:
  632.  
  633.     System Error occurred in DFH3 near 027D
  634.     AX=0005 BX=.. CX=.. DX=.. SI=.. DI=.. CS=264B DS=2724 ES=2830
  635.  
  636.     AX= INT 21 RETURN-CODE
  637.     CS= SEGMENT ADDRESS FOR DFH3
  638.     DS= SEGMENT ADDRESS FOR THE BUFFER SPECIFIED
  639.     ES= SEGMENT ADDRESS OF THE CALLING PROGRAM (e.i. GWBASIC)
  640.  
  641.            In the above message, 027D is the address of the open file
  642.     interrupt +3. AX=0005 is an access denied error.
  643.  
  644.  
  645.  
  646.  
  647.  
  648.                       SOME INTERNAL THOUGHTS
  649.  
  650.  
  651.            DISAM uses three buffers within the file handler. The first
  652.     is the control block buffer. It contains pointers, counters, and
  653.     the necessary things to manipulate the other two buffers. This
  654.     buffer is 128 bytes long and is built when the file is defined.
  655.  
  656.            The second buffer is the index block buffer. This buffer is
  657.     by default, 512 bytes in length and contains key records that
  658.     point to data blocks. There is a also a pointer to the next index
  659.     block. The first index block is numbered, block zero (0).
  660.  
  661.            The third buffer is the data block buffer. It is by
  662.     default, 2048 bytes in length and contains the data records.  The
  663.     data block also has a pointer to the next data block. The first
  664.     data block is numbered, block 1.
  665.  
  666.            Records are stored in the data block in ascending key
  667.     order. The last record in the data block has its key stored in the
  668.     index block with a pointer to the data block.
  669.  
  670.            When a record is added to the data block, the free space in
  671.     the data block is used. When the free space is used up, the data
  672.     block is split in half. A new index record is created pointing to
  673.     the new data block. The new record is then added to one of the
  674.     data blocks. The other remains half used.  Over time the DISAM
  675.     file will grow bigger than necessary and will have to be
  676.     compressed. There is a process using the utility program to
  677.     compress the file.
  678.  
  679.            The addition of new records is the most costly in response
  680.     time. Normally a record is added by simply rearranging the data
  681.     block in the buffer. No I/O required.  When a data block split
  682.     occurs there are four writes performed. If a data block split
  683.     causes an index block split, six writes are required before the
  684.     record is added. After a split occurs, all blocks will have been
  685.     written to the file.
  686.  
  687.            An example using the defaults; If the key length of a file
  688.     is 11 bytes. the index block can hold 33 data block keys.  If the
  689.     average length of a data record is 80 bytes, each data block can
  690.     hold 24 records. 24x33=792 Since the index block is already in the
  691.     buffer, with 1 I/O you have access to any one of 792, 80 byte
  692.     records.
  693.  
  694.  
  695.