Interbank Database, Part 2: TS-2068 and the Larken RAMdisk

See all articles from Sinc-Link v11 n2
Author(s): George Chambers
Publication: Sinc-Link
Pub Details: Sinc-Link v11 n2 (Volume 11, Issue 2)
Date: March/April 1993
Pages: 5-7

This is the second of two articles describing the insertion of blocks of prepared data into an interbank database.

The first article described how the data was massaged into Tasword files prior to being placed into the database. This article will describe the steps involved in actually moving it into the database, i.e. into the Ramdisk banks.

There are three distinct steps to this. First step is to finish massaging the Tasword files. Second step, inserting these Tasword files into the computer and RAMdisk banks. And thirdly, entering values into the INTERBANK program code to delineate the parameters of the database, i.e. length of each record, number of records, and number of databanks involved.

A Tasword file is not large enough to hold a complete bank of data. That is to say, a bank can hold 32768 bytes while a Tasword file can hold only 19200 characters. I decided to make up Tasword files of 256 lines (each line contains 64 characters). This gives us 16384 bytes, exactly half of the bank size of 32768 bytes. A very convenient size.

The reason for keeping the records in chronological order, from the beginning of the process is easy to explain. It is because of a serious flaw in the Interbank Database SORT feature code; every time a SORT is done a number of files become corrupted. A flaw that we have to work around, since the m/c programming involved is beyond my capabilities to correct.

There is really no need to sort this database, since it’s only natural order is chronological. So the cheap and dirty solution is to ensure the database is installed initially in it’s correct chronological order. And refrain from using the SORT function thereafter!

To get back to the task. Initially the Tasword files were of different sizes. It was necessary to create a series of Tasword files each exactly 256 lines in size. This was done by merging files and line deletion. Each file created by this means was saved off as “file01”, “file02”, etc., in chronological order, each file being exactly 256 lines (16384 bytes).

Now that the Tasword files described above have been created and saved, it was time to combine pairs of thes files to make blocks of code 32768 bytes in length, i.e. a bank of code containing 256 records.

I started off by loading the first file, the “file01.CT” from disk directly into an empty computer by the instruction: RANDOMIZE USR 100: LOAD “file01.CT” CODE 32768

Next I loaded the second file, “file02.CT”, with the instruction: RANDOMIZE USR 100: LOAD “file02.CT” CODE 49152

Now the computer is filled with the first bank of data. This was saved back to disk with the instruction:

RANDOMIZE USR 100: SAVE “bank00.C1” CODE 32768,32768.

Shut the computer off momentarily, to clear the memory. I then loaded the next two chronological files into the computer using the same process as above; saved this to disk the same way, using the filename “bank01.C1”.

The same process was used for the third bank of data. We now have three files, each containing 32768 bytes of data. Well, the last file, although we saved off 32768 bytes, was only partially filled with data. No matter.

I now have to create a new database shell to hold and manage these files. I loaded an existing database file, and selected the “NEW DATABASE” option. It asked for a new file name and the record length of the new file. I entered “SINCLI” and 128 bytes. The program then returned to the menu. I selected the option L)ist, and asked that it start listing at item 1. It proceeded to list records. Of course they were empty, but no matter. I am in the computer memory. When the “scroll?” prompt appears I enter “N”. A “PRESS ANY KEY” prompt appears. I BREAK into the Basic program. I then proceed to load the first datafile prepared and saved earlier, “bank00.C1”.

At this point we have the first block of data, “bank00.C1”, entered into the database. Enter GOTO 1, to re-enter the database. Select option L)ist, and start the listing at record 250. The records 250 to 256 contain SINC-LINK files. Record 257 and beyond contain rubbish. Actually, what has happened is that the first bank of the RAMdisk has been bankswitched, and you are viewing it.

Remember I said I had saved off the RAMdisk beforehand. Here’s the reason. We are going to write the next block of our new SINCLINK file over this RAMdisk bank right now.

When the “scroll?” appears, enter “N” , and then Break into Basic, as before. You must do this when you are viewing records between 256 and 511, because we want to load the second file, “bank01.C1”, into the first RAMdisk bank. We know records 256 to 511 are held in the first Ramdisk bank and also that when we are viewing them the RAMdisk bank has been switched, (interchanged) with the computer memory above address 32768. Did I lose you there!

I said I broke into Basic. I now load the second SINCLINK file, “bank01.C1”, into the computer. After this, I enter GOTO 1, to get into the database program. Doing this automatically restores the RAMdisk bank to it’s original status. Selecting option L)ist, I can then choose to start the listing at record 1, or 256, or 500, for example. All these will bring up SINCLINK files. However if I List 500 I will presently move along to record 512. At this point the second bank of RAMdisk will be bankswitched into the computer memory. When a “scroll?” prompt appears after record 512, break out of the program the same way as described previously, and proceed to load the last SINCLINK file “bank02” into the computer.

It is possible to do the bankswitching by using the OUT command. For example, one could switch the first RAMdisk bank in with the instruction OUT 244,240: OUT 7,71; and switch it out with OUT 244,0: OUT 7,0. However the approach used in this article seems to be somewhat simpler.

Re-enter the database program with a GOTO 1, and List starting at say, record 600. We are looking for the number of the last record in the file. When I come across it I shall write it down.

Since the database does not know how many records we have installed, I have to let it know. I do this by poking a number into the “SHELL.Cc” program code. Similarly, the database does not know how many banks are involved, and we have to poke that info in also. The addresses for the POKEs are:

-32766/67 The total number of records in the file.
-32765    The number of banks used by the file.
-32760    The length of each record.

Because the number of records exceeds 256 two addresses are required to hold the number. Use the Larken double-POKE feature: Enter RANDOMIZE USR 100: POKE 32766,x (where x is the number of the last record plus 1, that was recorded earlier.

The computer bank is referred to as “bank 0”; the first RAMdisk bank becomes “bank1”, and the second RAMdisk bank is “bank2”, and so on. We have used two RAMdisk banks, therefore enter POKE 32765,2. The length of each record was set earlier when the new database was established, and does not need to be entered manually.

The transfer of the SINC-LINK index data has been completed. Now all that remains to be done is to save the database to disk. Select the Q)uit option, and indicate which drive is to receive the data.