!
!
! MKISM.BAS ... program to build and execute a command file which will
! allocate a new ISAM file.
!
! Utilizes the empty index block calculations outlined in the article:
! "ISAM: Calculating the Number of Empty Index Blocks"
! - AMSD Journal, November, 1985
!
! Author: Creed Erickson
! Computer Systems Plus, Inc.
! 1630 Manheim Pike
! Lancaster, Pa. 17601
! (717)-560-0140
!
! This program is released to the public domain on 12-June-1986.
! The author assumes no liability for use of this program for any purpose.
!
! edit history (latest first):
!
! [001] New code. 12-Jun-86 / CAE
!
program MKISM,1.0(1)
map1 STRINGS
map2 ISAM'FILE'NAME, S,6 ! name of file to build
map2 IS'PRIMARY, S,1 ! primary index? (Y/N)
map2 DATA'FILE'DEVN, S,7 ! data file device and drive
map2 SECONDARY'INDEX'NAME,S,6 ! secondary index file spec
map2 LOAD'FROM'FILE, S,30 ! sequential load file spec
map1 REALS
map2 KEY'SIZE, F,6 ! user key size
map2 KEY'POSITION, F,6 ! position of key within rec
map2 RECORD'SIZE, F,6 ! size of data file record
map2 NUMBER'OF'RECS, F,6,100 ! number of records to allocate
map2 ACTUAL'KEYSIZ, F,6 ! actual size of key on disk
map2 DIRECTORY'ENTRY'SIZE,F,6 ! size of ISAM directory entry
map2 BLOCKING'FACTOR, F,6 ! # of ISAM directory entries per disk block
map2 HALF'FACTOR, F,6 ! one-half of the above number
map2 N, F,6 ! work variable
map2 FIRST'LEVEL, F,6 !--+
map2 SECOND'LEVEL, F,6 ! \
map2 THIRD'LEVEL, F,6 ! \
map2 FILE'SIZE, F,6 ! >>>--- see referenced article
map2 TOP'LEVEL, F,6 ! /
map2 MIDDLE'LEVEL, F,6 ! /
map2 BOTTOM'LEVEL, F,6 ! /
map2 SMALL'SIZE, F,6 !-+
map2 EMPTY'IDX'BLOCKS, F,6 ! # empty index blocks to allocate
print "Make ISAM file utility."
input line "Name of file to be built ";ISAM'FILE'NAME
input line "Size of key "; KEY'SIZE
input line "Position of key ";KEY'POSITION
input line "Size of record ";RECORD'SIZE
input line "Number of records to allocate ";NUMBER'OF'RECS
if (KEY'SIZE/2) = int(KEY'SIZE/2) then &
ACTUAL'KEYSIZ = KEY'SIZE &
else ACTUAL'KEYSIZ = KEY'SIZE + 1