|
DataMuseum.dkPresents historical artifacts from the history of: Q1 computer |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Q1 computer Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 13398 (0x3456) Types: Q1_HexDump, reclen=462 Notes: q1file Names: »KSAMDOX«
└─⟦39c04e87c⟧ Bits:30008591 DDMQ1-0025_LMC_KSAM_PROGRAMMERS_1 └─⟦this⟧ »KSAMDOX« └─⟦8f64076f3⟧ Bits:30008703 DDMQ1-0143_KSAM_PROGRAMMR └─⟦this⟧ »KSAMDOX« └─⟦fae79fcad⟧ Bits:30008592 DDMQ1-0025_LMC_KSAM_PROGRAMMERS └─⟦this⟧ »KSAMDOX«
0x0000…01ce (0,) 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 0d 4b 53 41 4d 20 50 52 4f 47 52 41 4d 4d 45 52 53 20 47 55 49 44 45 16 0d 0d 0d 0d 0d 0d 0d 09 09 09 47 61 72 79 20 47 6f 72 73 6c 69 ┆ KSAM PROGRAMMERS GUIDE Gary Gorsli┆ 0x0000…01ce 6e 65 0d 09 09 09 4f 63 74 6f 62 65 72 20 31 35 2c 20 31 39 37 37 0d 19 31 2e 20 49 6e 74 72 6f 64 75 63 74 69 6f 6e 0d 0d 09 54 68 65 20 4b 65 79 65 64 20 53 65 71 75 65 6e 74 69 61 6c 20 41 ┆ne October 15, 1977 1. Introduction The Keyed Sequential A┆ 0x0000…01ce 63 63 65 73 73 20 4d 65 74 68 6f 64 20 28 4b 53 41 4d 29 20 69 73 20 51 31 27 73 20 69 6e 64 65 78 65 64 20 66 69 6c 65 20 6f 72 67 61 6e 69 7a 61 74 69 6f 6e 2e 20 20 4b 53 41 4d 20 61 6c 6c ┆ccess Method (KSAM) is Q1's indexed file organization. KSAM all┆ 0x0000…01ce 6f 77 73 20 74 68 65 20 70 72 6f 67 72 61 6d 6d 65 72 20 74 6f 20 61 63 63 65 73 73 20 61 20 66 69 6c 65 20 62 79 20 61 20 64 61 74 61 20 69 74 65 6d 20 72 61 74 68 65 72 20 74 68 61 6e 20 73 ┆ows the programmer to access a file by a data item rather than s┆ 0x0000…01ce 65 71 75 65 6e 74 69 61 6c 6c 79 20 6f 72 20 62 79 20 72 65 63 6f 72 64 20 6e 75 6d 62 65 72 2e 20 20 41 20 66 69 6c 65 20 6f 72 67 61 6e 69 7a 65 64 20 69 6e 20 74 68 65 20 4b 53 41 4d 20 65 ┆equentially or by record number. A file organized in the KSAM e┆ 0x0000…01ce 6e 76 69 72 6f 6e 6d 65 6e 74 20 6d 61 79 20 62 65 20 73 65 71 75 65 6e 74 69 61 6c 6c 79 20 61 63 63 65 73 73 65 64 20 6f 72 20 72 61 6e 64 6f 6d 6c 79 20 61 63 63 65 73 73 65 64 20 61 74 20 ┆nvironment may be sequentially accessed or randomly accessed at ┆ 0x0000…01ce 74 68 65 20 73 61 6d 65 20 74 69 6d 65 2e 0d 09 45 61 63 68 20 4b 53 41 4d 20 66 69 6c 65 20 63 6f 6e 74 61 69 6e 73 20 6f 6e 65 20 6b 65 79 2e 20 20 41 20 6b 65 79 20 69 73 20 74 68 65 20 64 ┆the same time. Each KSAM file contains one key. A key is the d┆ 0x0000…01ce 61 74 61 20 69 74 65 6d 20 77 69 74 68 69 ┆ata item withi┆ 0x01ce…039c (1,) 6e 20 65 61 63 68 20 64 61 74 61 20 72 65 63 6f 72 64 20 77 68 69 63 68 20 69 73 20 75 73 65 64 20 74 6f 20 69 64 65 6e 74 69 66 79 20 74 68 61 74 20 70 61 72 74 69 63 75 6c 61 72 20 72 65 63 ┆n each data record which is used to identify that particular rec┆ 0x01ce…039c 6f 72 64 2e 20 20 28 54 77 6f 20 72 65 63 6f 72 64 73 20 6d 61 79 20 6e 6f 74 20 68 61 76 65 20 74 68 65 20 73 61 6d 65 20 6b 65 79 2e 29 20 20 54 68 65 20 6b 65 79 20 68 61 73 20 61 20 66 69 ┆ord. (Two records may not have the same key.) The key has a fi┆ 0x01ce…039c 78 65 64 20 70 6f 73 69 74 69 6f 6e 20 69 6e 20 74 68 65 20 64 61 74 61 20 72 65 63 6f 72 64 20 61 6e 64 20 6b 65 79 73 20 6d 61 79 20 68 61 76 65 20 61 20 66 69 78 65 64 20 6c 65 6e 67 74 68 ┆xed position in the data record and keys may have a fixed length┆ 0x01ce…039c 20 6f 66 20 31 20 74 6f 20 32 35 34 20 62 79 74 65 73 2c 20 61 6e 64 20 6d 61 79 20 6e 6f 74 20 65 78 74 65 6e 64 20 70 61 73 74 20 74 68 65 20 65 6e 64 20 6f 66 20 61 20 64 61 74 61 20 72 65 ┆ of 1 to 254 bytes, and may not extend past the end of a data re┆ 0x01ce…039c 63 6f 72 64 2e 20 20 44 61 74 61 20 72 65 63 6f 72 64 73 20 68 61 76 65 20 61 20 66 69 78 65 64 20 6c 65 6e 67 74 68 20 66 72 6f 6d 20 31 20 74 6f 20 35 30 39 20 62 79 74 65 73 2e 0d 09 54 68 ┆cord. Data records have a fixed length from 1 to 509 bytes. Th┆ 0x01ce…039c 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 61 20 72 65 63 6f 72 64 20 6d 61 79 20 62 65 20 72 65 61 64 20 6f 72 20 63 68 61 6e 67 65 64 2c 20 6f 72 20 72 65 63 6f 72 64 73 20 6d 61 79 20 62 65 ┆e contents of a record may be read or changed, or records may be┆ 0x01ce…039c 20 61 64 64 65 64 20 6f 72 20 64 65 6c 65 74 65 64 2e 20 20 41 66 74 65 72 20 61 20 72 61 6e 64 6f 6d 20 61 63 63 65 73 73 20 74 68 65 20 6e 65 78 74 20 6f 72 20 70 72 65 76 69 6f 75 73 20 72 ┆ added or deleted. After a random access the next or previous r┆ 0x01ce…039c 65 63 6f 72 64 20 69 6e 20 74 68 65 20 66 ┆ecord in the f┆ 0x039c…056a (2,) 69 6c 65 20 6d 61 79 20 61 6c 73 6f 20 62 65 20 61 63 63 65 73 73 65 64 2e 20 20 54 68 65 20 70 6f 69 6e 74 65 72 20 66 6f 72 20 6e 65 78 74 20 61 6e 64 20 70 72 65 76 69 6f 75 73 20 63 61 6e ┆ile may also be accessed. The pointer for next and previous can┆ 0x039c…056a 20 62 65 20 73 65 74 20 73 6f 20 74 68 61 74 20 74 68 65 20 73 75 63 63 65 65 64 69 6e 67 20 6e 65 78 74 20 6f 72 20 70 72 65 76 69 6f 75 73 20 77 69 6c 6c 20 61 63 63 65 73 73 20 61 20 72 65 ┆ be set so that the succeeding next or previous will access a re┆ 0x039c…056a 63 6f 72 64 20 77 69 74 68 20 74 68 65 20 73 61 6d 65 20 6b 65 79 20 28 6f 72 20 61 20 6b 65 79 20 6a 75 73 74 20 67 72 65 61 74 65 72 29 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 74 68 65 20 ┆cord with the same key (or a key just greater) contained in the ┆ 0x039c…056a 4b 53 41 4d 20 66 69 6c 65 2e 20 20 53 75 63 63 65 73 73 69 76 65 20 75 73 65 20 6f 66 20 6e 65 78 74 20 6f 72 20 70 72 65 76 69 6f 75 73 20 61 6c 6c 6f 77 73 20 66 6f 72 77 61 72 64 20 6f 72 ┆KSAM file. Successive use of next or previous allows forward or┆ 0x039c…056a 20 62 61 63 6b 77 61 72 64 20 73 65 71 75 65 6e 74 69 61 6c 20 61 63 63 65 73 73 20 6f 66 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 09 56 65 72 73 69 6f 6e 20 30 2e 30 20 6f 66 20 4b 53 ┆ backward sequential access of the KSAM file. Version 0.0 of KS┆ 0x039c…056a 41 4d 20 69 73 20 61 20 66 75 6c 6c 20 76 65 72 73 69 6f 6e 20 6f 66 20 4b 53 41 4d 20 69 6d 70 6c 65 6d 65 6e 74 65 64 20 61 73 20 61 20 73 65 72 69 65 73 20 6f 66 20 50 4c 31 20 73 75 62 72 ┆AM is a full version of KSAM implemented as a series of PL1 subr┆ 0x039c…056a 6f 75 74 69 6e 65 73 2e 20 20 54 68 65 20 73 75 62 72 6f 75 74 69 6e 65 73 20 75 73 65 20 61 62 6f 75 74 20 36 20 61 6e 64 20 31 2f 32 4b 20 6f 66 20 6d 65 6d 6f 72 79 2e 20 20 45 61 63 68 20 ┆outines. The subroutines use about 6 and 1/2K of memory. Each ┆ 0x039c…056a 4b 53 41 4d 20 66 69 6c 65 20 77 69 6c 6c ┆KSAM file will┆ 0x056a…0738 (3,) 20 72 65 71 75 69 72 65 20 61 20 63 6f 6e 74 72 6f 6c 20 61 72 65 61 20 6e 6f 74 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 32 20 61 6e 64 20 31 2f 34 4b 2e 0d 0d 0d 0d 32 2e 20 55 73 69 6e 67 ┆ require a control area not greater than 2 and 1/4K. 2. Using┆ 0x056a…0738 20 4b 53 41 4d 0d 0d 09 4c 69 6b 65 20 61 6e 79 20 6f 74 68 65 72 20 66 69 6c 65 20 61 20 4b 53 41 4d 20 66 69 6c 65 20 6d 75 73 74 20 62 65 20 61 6c 6c 6f 63 61 74 65 64 2e 20 20 54 68 65 20 ┆ KSAM Like any other file a KSAM file must be allocated. The ┆ 0x056a…0738 4b 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 69 73 20 75 73 65 64 20 74 6f 20 61 6c 6c 6f 63 61 74 65 2c 20 69 6e 69 74 69 61 6c 69 7a 65 2c 20 6c 6f 61 64 2c 20 75 6e 6c 6f 61 64 2c 20 ┆KSAMUTIL program is used to allocate, initialize, load, unload, ┆ 0x056a…0738 62 61 6c 61 6e 63 65 20 61 6e 64 20 72 65 63 6f 76 65 72 20 61 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 09 54 6f 20 61 63 63 65 73 73 20 61 20 4b 53 41 4d 20 66 69 6c 65 2c 20 74 68 65 20 70 72 6f ┆balance and recover a KSAM file. To access a KSAM file, the pro┆ 0x056a…0738 67 72 61 6d 20 6d 75 73 74 20 4f 50 45 4e 20 74 68 65 20 66 69 6c 65 2e 20 20 54 68 65 20 64 61 74 61 20 72 65 63 6f 72 64 73 20 6d 61 79 20 74 68 65 6e 20 62 65 20 61 63 63 65 73 73 65 64 20 ┆gram must OPEN the file. The data records may then be accessed ┆ 0x056a…0738 62 79 20 75 73 69 6e 67 20 74 68 65 20 52 45 41 44 2c 20 57 52 49 54 45 2c 20 41 44 44 2c 20 44 45 4c 45 54 45 2c 20 53 45 45 4b 2c 20 4e 45 58 54 2c 20 6f 72 20 50 52 45 56 49 4f 55 53 20 72 ┆by using the READ, WRITE, ADD, DELETE, SEEK, NEXT, or PREVIOUS r┆ 0x056a…0738 6f 75 74 69 6e 65 73 2e 20 20 41 66 74 65 72 20 61 63 63 65 73 73 69 6e 67 20 6f 66 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 20 74 68 65 20 70 72 6f 67 72 61 6d 20 6d 75 73 74 20 43 4c 4f 53 ┆outines. After accessing of the KSAM file the program must CLOS┆ 0x056a…0738 45 20 74 68 65 20 66 69 6c 65 2e 20 20 54 ┆E the file. T┆ 0x0738…0906 (4,) 68 69 73 20 69 73 20 6e 65 63 63 65 73 73 61 72 79 20 74 6f 20 75 70 64 61 74 65 20 61 6c 6c 20 74 68 65 20 73 74 61 74 75 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e 0d 09 49 66 20 66 6f 72 20 ┆his is neccessary to update all the status information. If for ┆ 0x0738…0906 73 6f 6d 65 20 72 65 61 73 6f 6e 20 61 20 4b 53 41 4d 20 66 69 6c 65 20 62 65 63 6f 6d 65 73 20 70 61 72 74 69 61 6c 6c 79 20 64 65 73 74 72 6f 79 65 64 2c 20 74 68 65 20 4b 53 41 4d 55 54 49 ┆some reason a KSAM file becomes partially destroyed, the KSAMUTI┆ 0x0738…0906 4c 20 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 73 61 6c 76 61 67 65 20 74 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 70 6f 72 74 69 6f 6e 73 2e 0d 09 41 20 4b 53 41 4d 20 66 69 6c 65 20 63 6f ┆L can be used to salvage the remaining portions. A KSAM file co┆ 0x0738…0906 6e 73 69 73 74 73 20 66 6f 20 74 68 72 65 65 20 66 69 6c 65 73 2e 20 20 41 20 73 6d 61 6c 6c 20 66 69 6c 65 20 77 68 6f 73 65 20 6e 61 6d 65 20 69 73 20 74 68 65 20 73 61 6d 65 20 61 73 20 74 ┆nsists fo three files. A small file whose name is the same as t┆ 0x0738…0906 68 65 61 74 20 6e 61 6d 65 20 65 6e 74 65 72 65 64 20 62 79 20 74 68 65 20 6f 70 65 72 61 74 6f 72 20 61 6e 64 20 74 77 6f 20 6f 74 68 65 72 20 66 69 6c 65 73 20 74 68 61 74 20 61 72 65 20 69 ┆heat name entered by the operator and two other files that are i┆ 0x0738…0906 64 65 6e 74 69 63 61 6c 2e 20 20 54 68 65 73 65 20 6c 61 72 67 65 72 20 66 69 6c 65 73 20 68 61 76 65 20 74 68 65 20 73 61 6d 65 20 6e 61 6d 65 20 61 73 20 74 68 65 20 73 6d 61 6c 6c 65 72 20 ┆dentical. These larger files have the same name as the smaller ┆ 0x0738…0906 65 78 63 65 70 74 20 74 68 61 74 20 74 68 65 20 6e 75 6d 65 72 61 6c 73 20 22 31 22 20 61 6e 64 20 22 32 22 20 68 61 76 65 20 62 65 65 6e 20 61 70 70 65 6e 64 65 64 20 74 6f 20 74 68 65 20 62 ┆except that the numerals "1" and "2" have been appended to the b┆ 0x0738…0906 65 67 69 6e 6e 69 6e 67 20 6f 66 20 74 68 ┆eginning of th┆ 0x0906…0ad4 (5,) 65 20 6e 61 6d 65 2e 20 20 54 68 65 20 74 68 72 65 65 20 66 69 6c 65 73 20 6d 61 79 20 62 65 20 73 70 6c 69 74 20 61 63 63 72 6f 73 73 20 74 77 6f 20 6f 72 20 74 68 72 65 65 20 64 72 69 76 65 ┆e name. The three files may be split accross two or three drive┆ 0x0906…0ad4 73 2e 0d 09 54 68 65 20 55 70 64 61 74 69 6e 67 20 53 65 76 65 72 69 74 79 20 49 6e 64 65 78 20 69 73 20 61 20 6e 75 6d 62 65 72 20 62 65 74 77 65 65 6e 20 30 20 61 6e 64 20 31 30 20 77 68 69 ┆s. The Updating Severity Index is a number between 0 and 10 whi┆ 0x0906…0ad4 63 68 20 69 64 65 6e 74 69 66 69 65 73 20 74 68 65 20 61 6d 6f 75 6e 74 20 6f 66 20 75 70 64 61 74 69 6e 67 20 74 68 69 73 20 66 69 6c 65 20 77 69 6c 6c 20 6e 6f 72 6d 61 6c 6c 79 20 72 65 63 ┆ch identifies the amount of updating this file will normally rec┆ 0x0906…0ad4 65 69 76 65 2e 20 20 54 68 69 73 20 6e 75 6d 62 65 72 20 63 61 6e 20 62 65 20 63 6f 6d 70 75 74 65 64 20 65 78 61 63 74 6c 79 20 62 79 20 74 68 65 20 4b 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 ┆eive. This number can be computed exactly by the KSAMUTIL progr┆ 0x0906…0ad4 61 6d 20 77 68 65 6e 20 61 20 66 69 6c 65 20 69 73 20 62 61 6c 61 6e 63 65 64 2e 20 20 57 68 65 6e 20 61 6c 6c 6f 63 61 74 69 6e 67 20 61 20 4b 53 41 4d 20 66 69 6c 65 2c 20 74 68 65 20 4b 53 ┆am when a file is balanced. When allocating a KSAM file, the KS┆ 0x0906…0ad4 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 63 61 6e 20 65 73 74 69 6d 61 74 65 20 74 68 65 20 55 70 64 61 74 69 6e 67 20 53 65 76 65 72 69 74 79 20 49 6e 64 65 78 20 66 72 6f 6d 20 69 6e 66 ┆AMUTIL program can estimate the Updating Severity Index from inf┆ 0x0906…0ad4 6f 72 6d 61 74 69 6f 6e 20 65 6e 74 65 72 65 64 20 62 79 20 74 68 65 20 6f 70 65 72 61 74 6f 72 2e 20 20 53 69 6e 63 65 20 74 68 69 73 20 69 73 20 6f 6e 6c 79 20 61 6e 20 65 73 74 69 6d 61 74 ┆ormation entered by the operator. Since this is only an estimat┆ 0x0906…0ad4 65 2c 20 74 68 65 20 61 63 74 75 61 6c 20 ┆e, the actual ┆ 0x0ad4…0ca2 (6,) 61 74 74 72 69 62 75 74 65 73 20 6f 66 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 20 6d 61 79 20 6e 65 65 64 20 74 6f 20 62 65 20 74 75 6e 65 64 20 61 66 74 65 72 20 74 68 65 20 6f 70 65 72 61 ┆attributes of the KSAM file may need to be tuned after the opera┆ 0x0ad4…0ca2 74 6f 72 20 68 61 73 20 67 6f 74 74 65 6e 20 61 6e 20 75 6e 64 65 72 73 74 61 6e 64 69 6e 67 20 6f 66 20 74 68 65 20 75 70 64 61 74 69 6e 67 20 66 72 65 71 75 65 6e 63 79 20 6f 66 20 68 69 73 ┆tor has gotten an understanding of the updating frequency of his┆ 0x0ad4…0ca2 20 70 61 72 74 69 63 75 6c 61 72 20 61 70 70 6c 69 63 61 74 69 6f 6e 2e 0d 09 45 78 61 6d 70 6c 65 73 20 6f 66 20 74 79 70 69 63 61 6c 20 55 70 64 61 74 69 6e 67 20 53 65 76 65 72 69 74 79 20 ┆ particular application. Examples of typical Updating Severity ┆ 0x0ad4…0ca2 49 6e 64 65 78 20 73 69 74 75 61 74 69 6f 6e 73 3a 0d 09 30 09 4e 6f 20 75 70 64 61 74 69 6e 67 20 6f 63 63 75 72 73 20 6f 6e 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 09 33 09 35 2d 31 ┆Index situations: 0 No updating occurs on the KSAM file. 3 5-1┆ 0x0ad4…0ca2 30 25 20 6f 66 20 74 68 65 20 66 69 6c 65 20 63 68 61 6e 67 65 73 20 62 65 74 77 65 65 6e 20 62 61 6c 61 6e 63 69 6e 67 2e 0d 09 36 09 33 30 2d 35 30 25 20 6f 66 20 74 68 65 20 66 69 6c 65 20 ┆0% of the file changes between balancing. 6 30-50% of the file ┆ 0x0ad4…0ca2 63 68 61 6e 67 65 73 20 62 65 74 77 65 65 6e 20 62 61 6c 61 6e 63 69 6e 67 2e 0d 09 08 31 30 09 54 68 65 20 66 69 6c 65 20 69 73 20 74 6f 74 61 6c 6c 79 20 63 68 61 6e 67 65 64 20 62 65 74 77 ┆changes between balancing. 10 The file is totally changed betw┆ 0x0ad4…0ca2 65 65 6e 20 62 61 6c 61 6e 63 69 6e 67 2e 19 09 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 65 78 61 6d 70 6c 65 73 20 61 72 65 20 66 6f 72 20 61 20 38 30 20 62 79 74 65 20 66 69 6c 65 20 77 69 ┆een balancing. The following examples are for a 80 byte file wi┆ 0x0ad4…0ca2 74 68 20 61 20 39 20 62 79 74 65 20 6b 65 ┆th a 9 byte ke┆ 0x0ca2…0e70 (7,) 79 20 73 74 61 72 74 69 6e 67 20 69 6e 20 74 68 65 20 66 69 72 73 74 20 70 6f 73 69 74 69 6f 6e 20 6f 66 20 74 68 65 20 64 61 74 61 20 72 65 63 6f 72 64 2e 20 20 41 20 63 6f 6e 74 72 6f 6c 20 ┆y starting in the first position of the data record. A control ┆ 0x0ca2…0e70 61 72 65 61 20 6f 66 20 32 20 61 6e 64 20 31 2f 34 4b 20 68 61 73 20 62 65 65 6e 20 61 6c 6c 6f 63 61 74 65 64 20 65 76 65 6e 20 74 68 6f 75 67 68 20 74 68 65 20 63 6f 6e 74 72 6f 6c 20 61 72 ┆area of 2 and 1/4K has been allocated even though the control ar┆ 0x0ca2…0e70 65 61 20 6e 65 65 64 20 6f 6e 6c 79 20 62 65 20 31 32 30 32 20 62 79 74 65 73 20 66 6f 72 20 74 68 69 73 20 65 78 61 6d 70 6c 65 2e 0d 0d 0d 0d 09 33 2e 20 4b 53 4f 50 45 4e 20 2d 20 4f 70 65 ┆ea need only be 1202 bytes for this example. 3. KSOPEN - Ope┆ 0x0ca2…0e70 6e 20 61 20 4b 53 41 4d 20 66 69 6c 65 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 20 50 4f 49 4e 54 45 52 2c ┆n a KSAM file Example: DCL KSSTR POINTER, KSCNTL POINTER,┆ 0x0ca2…0e70 0d 09 20 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c 09 2f 2a 52 65 74 75 72 6e 20 63 6f 64 65 2a 2f 0d 09 20 20 20 20 20 32 20 46 49 ┆ 1 KSSTRUCT, 2 RC CHAR(1), /*Return code*/ 2 FI┆ 0x0ca2…0e70 4c 45 4e 41 4d 45 20 43 48 41 52 28 37 29 2c 09 2f 2a 46 69 6c 65 20 74 6f 20 62 65 20 6f 70 65 6e 65 64 2a 2f 0d 09 20 20 20 20 4b 53 43 4e 54 4c 41 52 45 41 28 31 38 29 20 43 48 41 52 28 31 ┆LENAME CHAR(7), /*File to be opened*/ KSCNTLAREA(18) CHAR(1┆ 0x0ca2…0e70 32 38 29 3b 09 2f 2a 4b 53 41 4d 20 66 69 6c 65 20 63 6f 6e 74 72 6f 6c 20 61 72 65 61 2a 2f 0d 09 20 20 4b 53 53 54 52 3d 41 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b 09 2f 2a 53 65 74 20 75 ┆28); /*KSAM file control area*/ KSSTR=ADDR(KSSTRUCT); /*Set u┆ 0x0ca2…0e70 70 20 70 6f 69 6e 74 65 72 73 2a 2f 0d 09 ┆p pointers*/ ┆ 0x0e70…103e (8,) 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 0d 09 20 20 46 49 4c 45 4e 41 4d 45 3d 27 4b 46 49 4c 45 20 20 27 3b 09 2f 2a 50 61 64 20 77 69 74 68 ┆ KSCNTL=ADDR(KSCNTLAREA(1)); FILENAME='KFILE '; /*Pad with┆ 0x0e70…103e 20 62 6c 61 6e 6b 73 20 69 66 20 6e 6f 74 20 37 0d 09 09 63 68 61 72 73 20 2a 2f 0d 09 20 20 43 41 4c 4c 20 4b 53 4f 50 45 4e 28 4b 53 43 4e 54 4c 2c 4b 53 53 54 52 29 3b 09 2f 2a 6f 70 65 6e ┆ blanks if not 7 chars */ CALL KSOPEN(KSCNTL,KSSTR); /*open┆ 0x0e70…103e 20 4b 53 41 4d 20 66 69 6c 65 2a 2f 0d 09 20 20 49 46 20 52 43 7f 3d 27 20 27 20 54 48 45 4e 20 47 4f 20 54 4f 20 45 52 52 4f 52 3b 09 2f 2a 65 72 72 6f 72 20 64 75 72 69 6e 67 20 6f 70 65 6e ┆ KSAM file*/ IF RC =' ' THEN GO TO ERROR; /*error during open┆ 0x0e70…103e 2a 2f 0d 0d 09 54 68 65 20 61 72 65 61 73 20 69 6e 20 74 68 65 20 64 65 63 6c 61 72 65 20 61 72 65 20 75 73 65 64 20 62 79 20 74 68 65 20 4b 53 41 4d 20 72 6f 75 74 69 6e 65 73 20 61 73 20 61 ┆*/ The areas in the declare are used by the KSAM routines as a┆ 0x0e70…103e 20 77 6f 72 6b 20 61 72 65 61 20 61 6e 64 20 61 20 70 61 72 61 6d 65 74 65 72 20 61 72 65 61 20 77 68 65 6e 20 61 63 63 65 73 73 69 6e 67 20 61 20 4b 53 41 4d 20 66 69 6c 65 2e 20 20 45 61 63 ┆ work area and a parameter area when accessing a KSAM file. Eac┆ 0x0e70…103e 68 20 4b 53 41 4d 20 66 69 6c 65 20 61 20 70 72 6f 67 72 61 6d 20 61 63 63 65 73 73 65 73 20 6d 75 73 74 20 68 61 76 65 20 69 74 73 20 6f 77 6e 20 63 6f 6e 74 72 6f 6c 20 61 72 65 61 2e 0d 09 ┆h KSAM file a program accesses must have its own control area. ┆ 0x0e70…103e 4b 53 4f 50 45 4e 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 62 6c 61 6e 6b 20 69 6e 20 52 43 20 69 66 20 4f 50 45 4e 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2c 20 31 20 69 66 20 74 68 ┆KSOPEN will return a blank in RC if OPEN was successful, 1 if th┆ 0x0e70…103e 65 20 66 69 6c 65 20 69 73 20 6e 6f 74 20 ┆e file is not ┆ 0x103e…120c (9,) 6f 6e 20 49 4e 44 45 58 2c 20 6f 72 20 32 20 69 66 20 74 68 65 20 66 69 6c 65 20 69 73 20 6e 6f 74 20 61 63 63 65 73 73 61 62 6c 65 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 ┆on INDEX, or 2 if the file is not accessable due to a format err┆ 0x103e…120c 6f 72 2e 0d 0d 0d 0d 34 2e 20 4b 53 52 45 41 44 20 2d 20 52 61 6e 64 6f 6d 6c 79 20 52 65 61 64 20 61 20 52 65 63 6f 72 64 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 ┆or. 4. KSREAD - Randomly Read a Record Example: DCL KSSTR P┆ 0x103e…120c 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 ┆OINTER, KSCNTL POINTER, 1 KSSTRUCT, 2 RC CHAR(1)┆ 0x103e…120c 2c 0d 09 20 20 20 20 20 32 20 4b 53 4b 45 59 20 43 48 41 52 28 39 29 2c 09 2f 2a 4b 65 79 6c 65 6e 3d 39 2a 2f 0d 09 20 20 20 20 20 32 20 44 41 54 41 52 45 43 4f 52 44 20 43 48 41 52 28 37 31 ┆, 2 KSKEY CHAR(9), /*Keylen=9*/ 2 DATARECORD CHAR(71┆ 0x103e…120c 29 2c 09 2f 2a 52 65 63 6c 65 6e 3d 38 30 2a 2f 0d 09 20 20 20 20 4b 53 43 4e 54 4c 41 52 45 41 28 31 38 36 29 20 43 48 41 52 28 31 32 38 29 3b 0d 09 20 20 4b 53 53 54 52 3d 41 44 44 52 28 4b ┆), /*Reclen=80*/ KSCNTLAREA(186) CHAR(128); KSSTR=ADDR(K┆ 0x103e…120c 53 53 54 52 55 43 54 29 3b 09 2f 2a 53 65 74 20 75 70 20 70 6f 69 6e 74 65 72 73 2a 2f 0d 09 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 0d 09 20 ┆SSTRUCT); /*Set up pointers*/ KSCNTL=ADDR(KSCNTLAREA(1)); ┆ 0x103e…120c 20 4b 53 4b 45 59 3d 27 32 32 37 37 36 37 31 31 34 27 3b 09 2f 2a 46 69 6c 6c 20 69 6e 20 6b 65 79 2a 2f 0d 09 20 20 43 41 4c 4c 20 4b 53 52 45 41 44 28 4b 53 43 4e 54 4c 2c 4b 53 53 54 52 29 ┆ KSKEY='227767114'; /*Fill in key*/ CALL KSREAD(KSCNTL,KSSTR)┆ 0x103e…120c 3b 09 2f 2a 52 61 6e 64 6f 6d 6c 79 20 72 ┆; /*Randomly r┆ 0x120c…13da (10,) 65 61 64 20 4b 53 41 4d 20 66 69 6c 65 2a 2f 0d 09 20 20 49 46 20 52 43 7f 3d 27 20 27 20 54 48 45 4e 20 47 4f 20 54 4f 20 4b 45 59 5f 4e 4f 54 5f 46 4f 55 4e 44 3b 0d 0d 09 4b 53 52 45 41 44 ┆ead KSAM file*/ IF RC =' ' THEN GO TO KEY_NOT_FOUND; KSREAD┆ 0x120c…13da 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 62 6c 61 6e 6b 20 69 6e 20 52 43 20 69 66 20 74 68 65 20 52 45 41 44 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 ┆ will return a blank in RC if the READ was successful, 2 if the ┆ 0x120c…13da 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 61 63 63 65 73 73 61 62 6c 65 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 33 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 ┆file was not accessable due to a format error, 3 if the file was┆ 0x120c…13da 20 6e 6f 74 20 6f 70 65 6e 65 64 2c 20 6f 72 20 34 20 69 66 20 74 68 65 20 6b 65 79 20 77 61 73 20 6e 6f 74 20 61 6e 20 69 64 65 6e 74 69 66 69 65 72 20 6f 66 20 61 20 72 65 63 6f 72 64 20 69 ┆ not opened, or 4 if the key was not an identifier of a record i┆ 0x120c…13da 6e 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 0d 0d 35 2e 20 4b 53 57 52 49 54 45 20 2d 20 52 61 6e 64 6f 6d 6c 79 20 55 70 64 61 74 65 20 74 68 65 20 43 6f 6e 74 65 6e 74 73 20 6f 66 ┆n the KSAM file. 5. KSWRITE - Randomly Update the Contents of┆ 0x120c…13da 20 61 20 52 65 63 6f 72 64 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 53 43 4e 54 4c 20 50 4f 49 4e 54 45 52 2c 0d 09 20 ┆ a Record Example: DCL KSSTR POINTER, KSSCNTL POINTER, ┆ 0x120c…13da 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c 0d 09 20 20 20 20 20 32 20 4b 53 4b 45 59 20 43 48 41 52 28 39 29 2c 0d 09 20 20 20 20 20 ┆ 1 KSSTRUCT, 2 RC CHAR(1), 2 KSKEY CHAR(9), ┆ 0x120c…13da 32 20 44 41 54 41 52 45 43 4f 52 44 20 43 ┆2 DATARECORD C┆ 0x13da…15a8 (11,) 48 41 52 28 37 31 29 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 41 52 45 41 28 31 38 29 20 43 48 41 52 28 31 32 38 29 3b 0d 09 20 20 4b 53 53 54 52 3d 41 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b ┆HAR(71), KSCNTLAREA(18) CHAR(128); KSSTR=ADDR(KSSTRUCT);┆ 0x13da…15a8 0d 09 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 0d 09 20 20 4b 53 4b 45 59 3d 27 32 32 37 37 36 37 31 31 33 27 3b 09 2f 2a 20 46 69 6c 6c 20 69 ┆ KSCNTL=ADDR(KSCNTLAREA(1)); KSKEY='227767113'; /* Fill i┆ 0x13da…15a8 6e 20 6b 65 79 20 61 6e 64 20 64 61 74 61 20 2a 2f 0d 09 20 20 44 41 54 41 52 45 43 4f 52 44 3d 27 4b 4f 4f 4c 2c 20 4a 4f 45 20 52 45 53 49 44 49 4e 47 20 40 20 37 35 20 50 41 52 4b 20 4c 41 ┆n key and data */ DATARECORD='KOOL, JOE RESIDING @ 75 PARK LA┆ 0x13da…15a8 4e 45 27 3b 0d 09 20 20 43 41 4c 4c 20 4b 53 57 52 49 54 45 28 4b 53 43 4e 54 4c 2c 20 4b 53 53 54 52 29 3b 09 2f 2a 20 52 61 6e 64 6f 6d 6c 79 20 75 70 64 61 74 61 20 72 65 63 6f 72 64 20 2a ┆NE'; CALL KSWRITE(KSCNTL, KSSTR); /* Randomly updata record *┆ 0x13da…15a8 2f 0d 09 20 20 49 46 20 52 43 7f 3d 27 20 27 20 54 48 45 4e 20 47 4f 20 54 4f 20 4b 45 59 5f 4e 4f 54 5f 46 4f 55 4e 44 3b 0d 0d 09 4b 53 57 52 49 54 45 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 ┆/ IF RC =' ' THEN GO TO KEY_NOT_FOUND; KSWRITE will return ┆ 0x13da…15a8 61 20 62 6c 61 6e 6b 20 69 6e 20 52 43 20 69 66 20 74 68 65 20 75 70 64 61 74 65 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f ┆a blank in RC if the update was successful, 2 if the file was no┆ 0x13da…15a8 74 20 61 63 63 65 73 73 61 62 6c 65 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 33 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 6f 70 65 6e 65 64 ┆t accessable due to a format error, 3 if the file was not opened┆ 0x13da…15a8 2c 20 6f 72 20 34 20 69 66 20 74 68 65 20 ┆, or 4 if the ┆ 0x15a8…1776 (12,) 6b 65 79 20 77 61 73 20 6e 6f 74 20 61 6e 20 69 64 65 6e 74 69 66 69 65 72 20 6f 66 20 61 20 72 65 63 6f 72 64 20 69 6e 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 2e 20 20 49 66 20 52 43 20 77 ┆key was not an identifier of a record in the KSAM file. If RC w┆ 0x15a8…1776 61 73 20 6e 6f 74 20 62 6c 61 6e 6b 2c 20 6e 6f 20 6f 70 65 72 61 74 69 6f 6e 73 20 77 65 72 65 20 70 65 72 66 6f 72 6d 65 64 2e 20 20 54 68 65 20 6b 65 79 20 6f 66 20 74 68 65 20 72 65 63 6f ┆as not blank, no operations were performed. The key of the reco┆ 0x15a8…1776 72 64 20 6d 61 79 20 6e 6f 74 20 62 65 20 63 68 61 6e 67 65 64 20 77 69 74 68 20 4b 53 57 52 49 54 45 2e 0d 0d 0d 0d 36 2e 20 4b 53 44 45 4c 45 54 45 20 2d 20 44 65 6c 65 74 65 20 61 20 52 65 ┆rd may not be changed with KSWRITE. 6. KSDELETE - Delete a Re┆ 0x15a8…1776 63 6f 72 64 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 31 20 4b ┆cord Example: DCL KSSTR POINTER, KSCNTL POINTER, 1 K┆ 0x15a8…1776 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c 0d 09 20 20 20 20 20 32 20 4b 53 4b 45 59 20 43 48 41 52 28 39 29 2c 0d 09 20 20 20 20 4b 53 53 54 52 3d 41 ┆SSTRUCT, 2 RC CHAR(1), 2 KSKEY CHAR(9), KSSTR=A┆ 0x15a8…1776 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b 0d 09 20 20 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 0d 09 20 20 4b 53 4b 45 59 3d 27 32 32 37 37 36 ┆DDR(KSSTRUCT); KSCNTL=ADDR(KSCNTLAREA(1)); KSKEY='22776┆ 0x15a8…1776 37 31 31 35 27 3b 09 2f 2a 20 46 69 6c 6c 20 69 6e 20 6b 65 79 20 2a 2f 0d 09 20 20 43 41 4c 4c 20 4b 53 44 45 4c 45 54 45 28 4b 53 43 4e 54 4c 2c 20 4b 53 53 54 52 29 3b 09 2f 2a 20 52 61 6e ┆7115'; /* Fill in key */ CALL KSDELETE(KSCNTL, KSSTR); /* Ran┆ 0x15a8…1776 64 6f 6d 6c 79 20 64 65 6c 65 74 65 20 72 ┆domly delete r┆ 0x1776…1944 (13,) 65 63 6f 72 64 20 2a 2f 0d 09 20 20 49 46 20 52 43 7f 3d 27 20 27 20 54 48 45 4e 20 47 4f 20 54 4f 20 4b 45 59 5f 4e 4f 54 5f 46 4f 55 4e 44 3b 0d 0d 09 4b 53 44 45 4c 45 54 45 20 77 69 6c 6c ┆ecord */ IF RC =' ' THEN GO TO KEY_NOT_FOUND; KSDELETE will┆ 0x1776…1944 20 72 65 74 75 72 6e 20 61 20 62 6c 61 6e 6b 20 69 6e 20 52 43 20 69 66 20 74 68 65 20 75 70 64 61 74 65 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 66 69 6c ┆ return a blank in RC if the update was successful, 2 if the fil┆ 0x1776…1944 65 20 77 61 73 20 6e 6f 74 20 61 63 63 65 73 73 61 62 6c 65 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 33 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f ┆e was not accessable due to a format error, 3 if the file was no┆ 0x1776…1944 74 20 6f 70 65 6e 65 64 2c 20 6f 72 20 34 20 69 66 20 74 68 65 20 6b 65 79 20 77 61 73 20 6e 6f 74 20 61 6e 20 69 64 65 6e 74 69 66 69 65 72 20 6f 66 20 61 20 72 65 63 6f 72 64 20 69 6e 20 74 ┆t opened, or 4 if the key was not an identifier of a record in t┆ 0x1776…1944 68 65 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 0d 0d 37 2e 20 4b 53 41 44 44 20 2d 20 41 64 64 20 61 20 52 65 63 6f 72 64 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f ┆he KSAM file. 7. KSADD - Add a Record Example: DCL KSSTR PO┆ 0x1776…1944 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c ┆INTER, KSCNTL POINTER, 1 KSSTRUCT, 2 RC CHAR(1),┆ 0x1776…1944 0d 09 20 20 20 20 20 32 20 4b 53 4b 45 59 20 43 48 41 52 28 39 29 2c 0d 09 20 20 20 20 20 32 20 44 41 54 41 52 45 43 4f 52 44 20 43 48 41 52 28 37 31 29 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c ┆ 2 KSKEY CHAR(9), 2 DATARECORD CHAR(71), KSCNTL┆ 0x1776…1944 41 52 45 41 28 31 38 29 20 43 48 41 52 28 ┆AREA(18) CHAR(┆ 0x1944…1b12 (14,) 31 32 38 29 3b 0d 09 20 20 4b 53 53 54 52 3d 41 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b 0d 09 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 0d 09 ┆128); KSSTR=ADDR(KSSTRUCT); KSCNTL=ADDR(KSCNTLAREA(1)); ┆ 0x1944…1b12 20 20 4b 53 4b 45 59 3d 27 32 32 37 37 36 37 31 31 35 27 3b 09 2f 2a 20 46 69 6c 6c 20 69 6e 20 6b 65 79 20 61 6e 64 20 64 61 74 61 20 2a 2f 0d 09 20 20 44 41 54 41 52 45 43 4f 52 44 3d 27 4b ┆ KSKEY='227767115'; /* Fill in key and data */ DATARECORD='K┆ 0x1944…1b12 4f 4f 4c 2c 4a 4f 45 20 4a 52 20 4e 45 57 20 52 45 53 49 44 45 4e 54 27 3b 0d 09 20 20 43 41 4c 4c 20 4b 53 41 44 44 28 4b 53 43 4e 54 4c 2c 4b 53 53 54 52 29 3b 09 2f 2a 20 52 61 6e 64 6f 6e ┆OOL,JOE JR NEW RESIDENT'; CALL KSADD(KSCNTL,KSSTR); /* Randon┆ 0x1944…1b12 6c 79 20 61 64 64 20 72 65 63 6f 72 64 20 2a 2f 0d 09 20 20 49 46 20 52 43 7f 3d 27 20 27 20 54 48 45 4e 20 47 4f 20 54 4f 20 44 55 50 4c 49 43 41 54 45 5f 4b 45 59 3b 0d 0d 09 4b 53 41 44 44 ┆ly add record */ IF RC =' ' THEN GO TO DUPLICATE_KEY; KSADD┆ 0x1944…1b12 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 62 6c 61 6e 6b 20 69 6e 20 52 43 20 69 66 20 74 68 65 20 41 44 44 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 66 ┆ will return a blank in RC if the ADD was successful, 2 if the f┆ 0x1944…1b12 69 6c 65 20 77 61 73 20 6e 6f 74 20 61 63 63 65 73 73 61 62 6c 65 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 33 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 ┆ile was not accessable due to a format error, 3 if the file was ┆ 0x1944…1b12 6e 6f 74 20 6f 70 65 6e 65 64 2c 20 35 20 69 66 20 74 68 65 20 6b 65 79 20 61 6c 72 65 61 64 79 20 65 78 69 73 74 73 20 6f 6e 20 74 68 65 20 66 69 6c 65 20 28 6e 6f 20 6f 70 65 72 61 74 69 6f ┆not opened, 5 if the key already exists on the file (no operatio┆ 0x1944…1b12 6e 20 6f 63 63 75 72 65 64 29 2c 20 6f 72 ┆n occured), or┆ 0x1b12…1ce0 (15,) 20 36 20 69 66 20 74 68 65 20 66 69 6c 65 20 69 73 20 66 75 6c 6c 20 61 6e 64 20 74 68 65 20 72 65 63 6f 72 64 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 4b 53 4b 45 59 20 61 6e 64 20 44 41 54 ┆ 6 if the file is full and the record contained in KSKEY and DAT┆ 0x1b12…1ce0 41 52 45 43 4f 52 44 20 69 73 20 74 68 65 20 72 65 63 6f 72 64 20 77 68 69 63 68 20 77 6f 75 6c 64 6e 27 74 20 66 69 74 20 28 6e 6f 74 20 6e 65 63 63 65 73 73 61 72 69 6c 79 20 74 68 65 20 72 ┆ARECORD is the record which wouldn't fit (not neccessarily the r┆ 0x1b12…1ce0 65 63 6f 72 64 20 77 68 69 63 68 20 77 61 73 20 61 64 64 65 64 2e 29 0d 0d 0d 0d 38 2e 20 4b 53 53 45 45 4b 20 2d 20 53 65 74 20 66 69 6c 65 20 70 6f 73 69 74 69 6f 6e 20 66 6f 72 20 73 65 71 ┆ecord which was added.) 8. KSSEEK - Set file position for seq┆ 0x1b12…1ce0 75 65 6e 74 69 61 6c 20 61 63 63 65 73 73 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 20 50 4f 49 4e 54 45 52 ┆uential access Example: DCL KSSTR POINTER, KSCNTL POINTER┆ 0x1b12…1ce0 2c 0d 09 20 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c 0d 09 20 20 20 20 20 32 20 4b 53 4b 45 59 20 43 48 41 52 28 39 29 2c 0d 09 20 ┆, 1 KSSTRUCT, 2 RC CHAR(1), 2 KSKEY CHAR(9), ┆ 0x1b12…1ce0 20 20 20 4b 53 43 4e 54 4c 41 52 45 41 28 31 38 29 20 43 48 41 52 28 31 32 38 29 3b 0d 09 20 20 4b 53 53 54 52 3d 41 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b 0d 09 20 20 4b 53 43 4e 54 4c 3d ┆ KSCNTLAREA(18) CHAR(128); KSSTR=ADDR(KSSTRUCT); KSCNTL=┆ 0x1b12…1ce0 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 09 20 20 4b 53 4b 45 59 3d 27 32 32 37 37 36 30 30 30 30 27 3b 09 2f 2a 20 46 69 6c 6c 20 69 6e 20 6b 65 79 20 66 6f 72 20 73 65 ┆ADDR(KSCNTLAREA(1)); KSKEY='227760000'; /* Fill in key for se┆ 0x1b12…1ce0 61 72 63 68 20 2a 2f 0d 09 20 20 43 41 4c ┆arch */ CAL┆ 0x1ce0…1eae (16,) 4c 20 4b 53 53 45 45 4b 28 4b 53 43 4e 54 4c 2c 20 4b 53 53 54 52 29 3b 09 2f 2a 20 50 6f 73 69 74 69 6f 6e 20 70 6f 69 6e 74 65 72 73 20 66 6f 72 20 6e 65 78 74 20 2a 2f 0d 09 20 20 49 46 20 ┆L KSSEEK(KSCNTL, KSSTR); /* Position pointers for next */ IF ┆ 0x1ce0…1eae 52 43 7f 3d 27 20 27 20 54 48 45 4e 20 47 4f 20 54 4f 20 45 52 52 4f 52 3b 0d 0d 09 4b 53 53 45 45 4b 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 62 6c 61 6e 6b 20 69 6e 20 52 43 20 69 66 20 ┆RC =' ' THEN GO TO ERROR; KSSEEK will return a blank in RC if ┆ 0x1ce0…1eae 74 68 65 20 53 45 45 4b 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 61 63 63 65 73 73 61 62 6c 65 20 64 75 65 20 74 6f ┆the SEEK was successful, 2 if the file was not accessable due to┆ 0x1ce0…1eae 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 6f 72 20 33 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 6f 70 65 6e 65 64 2e 20 20 4b 53 53 45 45 4b 20 77 69 6c 6c 20 70 6f 73 ┆ format error, or 3 if the file was not opened. KSSEEK will pos┆ 0x1ce0…1eae 69 74 69 6f 6e 20 74 68 65 20 70 6f 69 6e 74 65 72 73 20 73 6f 20 74 68 61 74 20 6f 6e 20 61 20 73 75 63 63 65 65 64 69 6e 67 20 4e 45 58 54 20 6f 70 65 72 61 74 69 6f 6e 2c 20 74 68 65 20 64 ┆ition the pointers so that on a succeeding NEXT operation, the d┆ 0x1ce0…1eae 61 74 61 20 72 65 63 6f 72 64 20 77 69 74 68 20 74 68 65 20 6b 65 79 20 65 71 75 61 6c 20 74 6f 20 74 68 65 20 6b 65 79 20 75 73 65 64 20 69 6e 20 74 68 65 20 53 45 45 4b 20 6f 70 65 72 61 74 ┆ata record with the key equal to the key used in the SEEK operat┆ 0x1ce0…1eae 69 6f 6e 20 77 69 6c 6c 20 62 65 20 72 65 61 64 2e 20 20 49 66 20 74 68 65 72 65 20 69 73 20 6e 6f 74 20 61 20 72 65 63 6f 72 64 20 77 69 74 68 20 61 20 6b 65 79 20 65 71 75 61 6c 20 74 6f 20 ┆ion will be read. If there is not a record with a key equal to ┆ 0x1ce0…1eae 74 68 65 20 6b 65 79 20 75 73 65 64 20 69 ┆the key used i┆ 0x1eae…207c (17,) 6e 20 74 68 65 20 53 45 45 4b 2c 20 74 68 65 20 70 6f 69 6e 74 65 72 20 77 69 6c 6c 20 62 65 20 73 65 74 20 74 6f 20 74 68 65 20 6e 65 78 74 20 72 65 63 6f 72 64 20 77 69 74 68 20 61 20 6b 65 ┆n the SEEK, the pointer will be set to the next record with a ke┆ 0x1eae…207c 79 20 67 72 65 61 74 65 72 20 74 68 61 6e 20 74 68 65 20 6f 6e 65 20 75 73 65 64 20 69 6e 20 74 68 65 20 53 45 45 4b 2e 0d 0d 0d 0d 39 2e 20 4b 53 4e 45 58 54 20 2d 20 41 73 63 65 6e 64 69 6e ┆y greater than the one used in the SEEK. 9. KSNEXT - Ascendin┆ 0x1eae…207c 67 20 53 65 71 75 65 6e 74 69 61 6c 20 52 65 61 64 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 20 50 4f 49 4e ┆g Sequential Read Example: DCL KSSTR POINTER, KSCNTL POIN┆ 0x1eae…207c 54 45 52 2c 0d 09 20 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c 0d 09 20 20 20 20 20 32 20 4b 53 4b 45 59 20 43 48 41 52 28 39 29 2c ┆TER, 1 KSSTRUCT, 2 RC CHAR(1), 2 KSKEY CHAR(9),┆ 0x1eae…207c 0d 09 20 20 20 20 20 32 20 44 41 54 41 52 45 43 4f 52 44 20 43 48 41 52 28 37 31 29 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 41 52 45 41 28 31 38 29 20 43 48 41 52 28 31 32 38 29 3b 0d 09 20 20 ┆ 2 DATARECORD CHAR(71), KSCNTLAREA(18) CHAR(128); ┆ 0x1eae…207c 4b 53 53 54 52 3d 41 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b 0d 09 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 0d 09 20 20 43 41 4c 4c 20 4b 53 ┆KSSTR=ADDR(KSSTRUCT); KSCNTL=ADDR(KSCNTLAREA(1)); CALL KS┆ 0x1eae…207c 4e 45 58 54 28 4b 53 43 4e 54 4c 2c 4b 53 53 54 52 29 3b 09 2f 2a 20 46 6f 72 77 61 72 64 20 73 65 71 75 65 6e 74 69 61 6c 20 72 65 61 64 20 2a 2f 0d 09 20 20 49 46 20 52 43 7f 3d 27 20 27 20 ┆NEXT(KSCNTL,KSSTR); /* Forward sequential read */ IF RC =' ' ┆ 0x1eae…207c 54 48 45 4e 20 47 4f 20 54 4f 20 45 4e 44 ┆THEN GO TO END┆ 0x207c…224a (18,) 5f 4f 46 5f 46 49 4c 45 3b 0d 0d 09 57 68 65 6e 20 4b 53 4e 45 58 54 20 69 73 20 75 73 65 64 20 61 66 74 65 72 20 4b 53 53 45 45 4b 2c 20 4b 53 4e 45 58 54 20 77 69 6c 6c 20 72 65 61 64 20 74 ┆_OF_FILE; When KSNEXT is used after KSSEEK, KSNEXT will read t┆ 0x207c…224a 68 65 20 72 65 63 6f 72 64 20 66 6f 75 6e 64 20 64 75 72 69 6e 67 20 74 68 65 20 53 45 45 4b 2e 20 20 41 6e 79 20 6f 74 68 65 72 20 74 69 6d 65 20 4b 53 4e 45 58 54 20 69 73 20 75 73 65 64 2c ┆he record found during the SEEK. Any other time KSNEXT is used,┆ 0x207c…224a 20 74 68 65 20 72 65 63 6f 72 64 20 77 68 6f 73 65 20 6b 65 79 20 69 73 20 6a 75 73 74 20 67 72 65 61 74 65 72 20 74 68 61 74 20 74 68 65 20 72 65 63 6f 72 64 20 6a 75 73 74 20 61 63 63 65 73 ┆ the record whose key is just greater that the record just acces┆ 0x207c…224a 73 65 64 20 69 73 20 72 65 61 64 2e 0d 09 4b 53 4e 45 58 54 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 62 6c 61 6e 6b 20 69 6e 20 52 43 20 69 66 20 4e 45 58 54 20 77 61 73 20 73 75 63 63 65 ┆sed is read. KSNEXT will return a blank in RC if NEXT was succe┆ 0x207c…224a 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 61 63 63 65 73 73 61 62 6c 65 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 33 ┆ssful, 2 if the file was not accessable due to a format error, 3┆ 0x207c…224a 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 6f 70 65 6e 2c 20 6f 72 20 37 20 77 68 65 6e 20 70 61 73 73 65 64 20 65 6e 64 20 6f 66 20 66 69 6c 65 2e 0d 0d 0d 0d 31 30 2e 20 ┆ if the file was not open, or 7 when passed end of file. 10. ┆ 0x207c…224a 4b 53 50 52 45 56 55 53 20 2d 20 44 65 73 63 65 6e 64 69 6e 67 20 53 65 71 75 65 6e 74 69 61 6c 20 52 65 61 64 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f 49 4e 54 ┆KSPREVUS - Descending Sequential Read Example: DCL KSSTR POINT┆ 0x207c…224a 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 ┆ER, KSCNT┆ 0x224a…2418 (19,) 4c 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c 0d 09 20 20 20 20 20 32 20 4b 53 4b 45 59 20 43 48 ┆L POINTER, 1 KSSTRUCT, 2 RC CHAR(1), 2 KSKEY CH┆ 0x224a…2418 41 52 28 39 29 2c 0d 09 20 20 20 20 20 32 20 44 41 54 41 52 45 43 4f 52 44 20 43 48 41 52 28 37 31 29 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 41 52 45 41 28 31 38 29 20 43 48 41 52 28 31 32 38 ┆AR(9), 2 DATARECORD CHAR(71), KSCNTLAREA(18) CHAR(128┆ 0x224a…2418 29 3b 0d 09 20 20 4b 53 53 54 52 3d 41 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b 0d 09 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 28 31 29 29 3b 0d 0d 09 20 20 43 ┆); KSSTR=ADDR(KSSTRUCT); KSCNTL=ADDR(KSCNTLAREA(1)); C┆ 0x224a…2418 41 4c 4c 20 4b 53 50 52 45 56 55 53 28 4b 53 43 4e 54 4c 2c 20 4b 53 53 54 52 29 3b 09 2f 2a 20 42 61 63 6b 77 61 72 64 20 73 65 71 75 65 6e 74 69 61 6c 20 72 65 61 64 20 2a 2f 0d 09 20 20 49 ┆ALL KSPREVUS(KSCNTL, KSSTR); /* Backward sequential read */ I┆ 0x224a…2418 46 20 52 43 7f 3d 27 20 27 20 54 48 45 4e 20 47 4f 20 54 4f 20 42 45 47 49 4e 4e 49 4e 47 5f 4f 46 5f 46 49 4c 45 3b 0d 0d 09 57 68 65 6e 20 4b 53 50 52 45 56 55 53 20 69 73 20 75 73 65 64 20 ┆F RC =' ' THEN GO TO BEGINNING_OF_FILE; When KSPREVUS is used ┆ 0x224a…2418 61 66 74 65 72 20 4b 53 53 45 45 4b 2c 20 4b 53 50 52 45 56 55 53 20 77 69 6c 6c 20 72 65 61 64 20 74 68 65 20 72 65 63 6f 72 64 20 66 6f 75 6e 64 20 64 75 72 69 6e 67 20 74 68 65 20 53 45 45 ┆after KSSEEK, KSPREVUS will read the record found during the SEE┆ 0x224a…2418 4b 2e 20 20 41 6e 79 20 6f 74 68 65 72 20 74 69 6d 65 20 4b 53 50 52 45 56 55 53 20 69 73 20 75 73 65 64 2c 20 74 68 65 20 72 65 63 6f 72 64 20 77 68 6f 73 65 20 6b 65 79 20 69 73 20 6a 75 73 ┆K. Any other time KSPREVUS is used, the record whose key is jus┆ 0x224a…2418 74 20 6c 65 73 73 20 74 68 61 6e 20 74 68 ┆t less than th┆ 0x2418…25e6 (20,) 65 20 72 65 63 6f 72 64 20 6a 75 73 74 20 61 63 63 65 73 73 65 64 20 69 73 20 72 65 61 64 2e 0d 09 4b 53 50 52 45 56 55 53 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 62 6c 61 6e 6b 20 69 6e ┆e record just accessed is read. KSPREVUS will return a blank in┆ 0x2418…25e6 20 52 43 20 69 66 20 50 52 45 56 49 4f 55 53 20 77 61 73 20 73 75 63 63 65 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 61 63 63 65 73 73 69 62 6c 65 ┆ RC if PREVIOUS was successful, 2 if the file was not accessible┆ 0x2418…25e6 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 33 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 6f 70 65 6e 2c 20 6f 72 20 37 20 77 68 65 6e 20 70 61 ┆ due to a format error, 3 if the file was not open, or 7 when pa┆ 0x2418…25e6 73 74 20 74 68 65 20 62 65 67 69 6e 6e 69 6e 67 20 6f 66 20 74 68 65 20 66 69 6c 65 2e 0d 0d 0d 0d 31 31 2e 20 4b 53 43 4c 4f 53 45 20 2d 20 43 6c 6f 73 65 20 61 20 4b 53 41 4d 20 66 69 6c 65 ┆st the beginning of the file. 11. KSCLOSE - Close a KSAM file┆ 0x2418…25e6 20 62 65 66 6f 72 65 20 65 78 69 74 69 6e 67 20 70 72 6f 67 72 61 6d 0d 0d 45 78 61 6d 70 6c 65 3a 0d 09 44 43 4c 20 4b 53 53 54 52 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 4b 53 43 4e 54 ┆ before exiting program Example: DCL KSSTR POINTER, KSCNT┆ 0x2418…25e6 4c 20 50 4f 49 4e 54 45 52 2c 0d 09 20 20 20 20 31 20 4b 53 53 54 52 55 43 54 2c 0d 09 20 20 20 20 32 20 52 43 20 43 48 41 52 28 31 29 2c 0d 09 20 20 20 20 4b 53 43 4e 54 4c 41 52 45 41 28 31 ┆L POINTER, 1 KSSTRUCT, 2 RC CHAR(1), KSCNTLAREA(1┆ 0x2418…25e6 38 29 20 43 48 41 52 28 31 32 38 29 3b 0d 09 20 20 4b 53 53 54 52 3d 41 44 44 52 28 4b 53 53 54 52 55 43 54 29 3b 0d 09 20 20 4b 53 43 4e 54 4c 3d 41 44 44 52 28 4b 53 43 4e 54 4c 41 52 45 41 ┆8) CHAR(128); KSSTR=ADDR(KSSTRUCT); KSCNTL=ADDR(KSCNTLAREA┆ 0x2418…25e6 28 31 29 29 3b 0d 0d 09 20 20 43 41 4c 4c ┆(1)); CALL┆ 0x25e6…27b4 (21,) 20 4b 53 43 4c 4f 53 45 28 4b 53 43 4e 54 4c 2c 4b 53 53 54 52 29 3b 09 2f 2a 20 43 6c 6f 73 65 20 4b 53 41 4d 20 66 69 6c 65 20 2a 2f 0d 09 20 20 49 46 20 52 43 7f 3d 27 20 27 20 20 54 48 45 ┆ KSCLOSE(KSCNTL,KSSTR); /* Close KSAM file */ IF RC =' ' THE┆ 0x25e6…27b4 4e 20 47 4f 20 54 4f 20 45 52 52 4f 52 3b 0d 0d 09 4b 53 43 4c 4f 53 45 20 69 73 20 72 65 71 75 69 72 65 64 20 66 6f 72 20 61 6c 6c 20 6f 70 65 6e 65 64 20 4b 53 41 4d 20 66 69 6c 65 73 20 62 ┆N GO TO ERROR; KSCLOSE is required for all opened KSAM files b┆ 0x25e6…27b4 65 66 6f 72 65 20 61 20 70 72 6f 67 72 61 6d 20 68 61 6c 74 73 2e 20 20 52 43 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e 20 61 20 62 6c 61 6e 6b 20 69 66 20 4b 53 43 4c 4f 53 45 20 77 61 73 20 73 ┆efore a program halts. RC will contain a blank if KSCLOSE was s┆ 0x25e6…27b4 75 63 63 65 73 73 66 75 6c 2c 20 32 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 63 6c 6f 73 65 64 20 64 75 65 20 74 6f 20 61 20 66 6f 72 6d 61 74 20 65 72 72 6f 72 2c 20 6f ┆uccessful, 2 if the file was not closed due to a format error, o┆ 0x25e6…27b4 72 20 33 20 69 66 20 74 68 65 20 66 69 6c 65 20 77 61 73 20 6e 6f 74 20 6f 70 65 6e 2e 19 31 32 2e 20 4b 53 41 4d 55 54 49 4c 20 2d 20 54 68 65 20 4b 53 41 4d 20 55 74 69 6c 69 74 79 0d 0d 09 ┆r 3 if the file was not open. 12. KSAMUTIL - The KSAM Utility ┆ 0x25e6…27b4 41 2e 20 41 4c 4c 4f 43 41 54 45 20 2d 20 41 6c 6c 6f 63 61 74 69 6e 67 20 61 6e 64 20 49 6e 69 74 69 61 6c 69 7a 69 6e 67 20 61 20 4b 53 41 4d 20 46 69 6c 65 0d 0d 09 54 68 65 20 4b 53 41 4d ┆A. ALLOCATE - Allocating and Initializing a KSAM File The KSAM┆ 0x25e6…27b4 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 77 69 6c 6c 20 61 6c 6c 6f 63 61 74 65 20 61 20 4b 53 41 4d 20 66 69 6c 65 20 61 6e 64 20 69 6e 69 74 69 61 6c 69 7a 65 20 74 68 65 20 66 69 6c 65 20 74 ┆UTIL program will allocate a KSAM file and initialize the file t┆ 0x25e6…27b4 6f 20 63 6f 6e 74 61 69 6e 20 7a 65 72 6f ┆o contain zero┆ 0x27b4…2982 (22,) 20 72 65 63 6f 72 64 73 2e 20 20 54 68 65 20 4b 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 70 72 6f 6d 70 74 73 20 74 68 65 20 6f 70 65 72 61 74 6f 72 20 66 6f 72 20 74 68 65 20 66 6f 6c ┆ records. The KSAMUTIL program prompts the operator for the fol┆ 0x27b4…2982 6c 6f 77 69 6e 67 20 69 74 65 6d 73 3a 0d 0d 09 31 2e 20 27 45 4e 54 45 52 20 55 54 49 4c 49 54 59 20 46 55 4e 43 54 49 4f 4e 3a 27 20 2d 20 45 6e 74 65 72 27 41 27 20 66 6f 72 20 41 6c 6c 6f ┆lowing items: 1. 'ENTER UTILITY FUNCTION:' - Enter'A' for Allo┆ 0x27b4…2982 63 61 74 65 2e 0d 09 32 2e 20 27 45 4e 54 45 52 20 46 49 4c 45 20 4e 41 4d 45 3a 27 20 2d 20 45 6e 74 65 72 20 61 20 31 20 74 6f 20 37 20 63 68 61 72 61 63 74 65 72 20 46 69 6c 65 6e 61 6d 65 ┆cate. 2. 'ENTER FILE NAME:' - Enter a 1 to 7 character Filename┆ 0x27b4…2982 2e 0d 09 33 2e 20 27 45 4e 54 45 52 20 52 45 43 4f 52 44 20 4c 45 4e 47 54 48 3a 27 20 2d 20 45 6e 74 65 72 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 69 6e 20 74 68 65 20 ┆. 3. 'ENTER RECORD LENGTH:' - Enter the number of bytes in the ┆ 0x27b4…2982 64 61 74 61 20 72 65 63 6f 72 64 2c 0d 09 20 20 6b 65 79 20 69 73 20 69 6e 63 6c 75 64 65 64 20 69 6e 20 74 68 65 20 64 61 74 61 20 72 65 63 6f 72 64 2e 0d 09 34 2e 20 27 45 4e 54 45 52 20 4b ┆data record, key is included in the data record. 4. 'ENTER K┆ 0x27b4…2982 45 59 20 4c 45 4e 47 54 48 3a 27 2c 20 2d 20 45 6e 74 65 72 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 69 6e 20 74 68 65 20 6b 65 79 2e 0d 09 35 2e 20 27 45 4e 54 45 52 20 ┆EY LENGTH:', - Enter the number of bytes in the key. 5. 'ENTER ┆ 0x27b4…2982 54 48 45 20 41 56 45 52 41 47 45 20 4e 55 4d 42 45 52 20 4f 46 20 52 45 43 4f 52 44 53 20 49 4e 20 54 48 45 20 44 41 54 41 20 53 45 54 3a 27 0d 09 36 2e 20 27 45 4e 54 45 52 20 54 48 45 20 55 ┆THE AVERAGE NUMBER OF RECORDS IN THE DATA SET:' 6. 'ENTER THE U┆ 0x27b4…2982 50 44 41 54 49 4e 47 20 53 45 56 45 52 49 ┆PDATING SEVERI┆ 0x2982…2b50 (23,) 54 59 20 49 4e 44 45 58 20 4f 52 20 46 31 27 0d 09 09 36 61 2e 20 28 46 31 20 65 6e 74 65 72 65 64 29 20 45 6e 74 65 72 20 4d 61 78 69 6d 75 6d 20 4e 75 6d 62 65 72 20 6f 66 20 52 65 63 6f 72 ┆TY INDEX OR F1' 6a. (F1 entered) Enter Maximum Number of Recor┆ 0x2982…2b50 64 73 2e 0d 09 09 36 62 2e 20 28 46 31 20 65 6e 74 65 72 65 64 29 20 45 6e 74 65 72 20 74 68 65 20 61 76 65 72 61 67 65 20 6e 75 6d 62 65 72 20 6f 66 20 61 64 64 73 20 62 65 74 77 65 65 6e 0d ┆ds. 6b. (F1 entered) Enter the average number of adds between ┆ 0x2982…2b50 09 09 20 20 62 61 6c 61 6e 63 69 6e 67 2e 0d 0d 0d 09 37 2e 20 45 6e 74 65 72 20 74 68 65 20 6b 65 79 20 70 6f 73 69 74 69 6f 6e 20 69 6e 20 62 79 74 65 73 2e 0d 0d 09 42 2e 20 49 4e 49 54 49 ┆ balancing. 7. Enter the key position in bytes. B. INITI┆ 0x2982…2b50 41 4c 20 2d 20 49 6e 69 74 69 61 6c 69 7a 69 6e 67 20 61 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 09 54 68 65 20 4b 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 77 69 6c 6c 20 69 6e 69 74 69 ┆AL - Initializing a KSAM file. The KSAMUTIL program will initi┆ 0x2982…2b50 61 6c 69 7a 65 20 61 6e 20 65 78 69 73 74 69 6e 67 20 4b 53 41 4d 20 66 69 6c 65 20 74 6f 20 63 6f 6e 74 61 69 6e 20 7a 65 72 6f 20 72 65 63 6f 72 64 73 2e 20 20 54 68 65 20 4b 53 41 4d 55 54 ┆alize an existing KSAM file to contain zero records. The KSAMUT┆ 0x2982…2b50 49 4c 20 70 72 6f 67 72 61 6d 20 70 72 6f 6d 70 74 73 20 74 68 65 20 6f 70 65 72 61 74 6f 72 20 66 6f 72 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 69 74 65 6d 73 3a 0d 0d 09 31 2e 20 27 45 ┆IL program prompts the operator for the following items: 1. 'E┆ 0x2982…2b50 4e 54 45 52 20 55 54 49 4c 49 54 59 20 46 55 4e 43 54 49 4f 4e 3a 27 20 2d 20 45 6e 74 65 72 20 49 4e 49 54 49 41 4c 20 66 6f 72 20 69 6e 69 74 69 61 6c 69 7a 65 2e 0d 09 32 2e 20 27 45 4e 54 ┆NTER UTILITY FUNCTION:' - Enter INITIAL for initialize. 2. 'ENT┆ 0x2982…2b50 45 52 20 46 49 4c 45 4e 41 4d 45 3a 27 20 ┆ER FILENAME:' ┆ 0x2b50…2d1e (24,) 2d 20 45 6e 74 65 72 20 4b 53 41 4d 20 66 69 6c 65 20 6e 61 6d 65 2e 0d 0d 0d 43 2e 20 4c 4f 41 44 20 2d 20 4c 6f 61 64 69 6e 67 20 61 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 09 54 68 65 20 4b ┆- Enter KSAM file name. C. LOAD - Loading a KSAM file. The K┆ 0x2b50…2d1e 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 77 69 6c 6c 20 6c 6f 61 64 20 61 20 4b 53 41 4d 20 66 69 6c 65 20 77 69 74 68 20 74 68 65 20 64 61 74 61 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e ┆SAMUTIL program will load a KSAM file with the data contained in┆ 0x2b50…2d1e 20 61 20 73 65 71 75 65 6e 74 69 61 6c 20 66 69 6c 65 2e 20 20 49 66 20 74 68 65 20 73 65 71 75 65 6e 74 69 61 6c 20 66 69 6c 65 20 69 73 20 69 6e 20 61 73 63 65 6e 64 69 6e 67 20 6b 65 79 20 ┆ a sequential file. If the sequential file is in ascending key ┆ 0x2b50…2d1e 6f 72 64 65 72 2c 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 20 77 69 6c 6c 20 62 65 20 6c 6f 61 64 65 64 20 69 6e 20 61 20 62 61 6c 61 6e 63 65 64 20 6d 6f 64 65 2e 20 20 49 66 20 74 68 65 20 ┆order, the KSAM file will be loaded in a balanced mode. If the ┆ 0x2b50…2d1e 73 65 71 75 65 6e 74 69 61 6c 20 66 69 6c 65 20 69 73 20 6e 6f 20 69 6e 20 6b 65 79 20 6f 72 64 65 72 2c 20 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 4b 53 41 4d 20 66 69 6c 65 20 77 69 6c 6c ┆sequential file is no in key order, the resulting KSAM file will┆ 0x2b50…2d1e 20 68 61 76 65 20 70 6f 73 73 69 62 6c 65 20 64 65 6c 61 79 73 20 77 68 65 6e 20 72 61 6e 64 6f 6d 20 61 64 64 73 20 61 72 65 20 70 65 72 66 6f 72 6d 65 64 2e 20 20 54 68 65 20 4b 53 41 4d 55 ┆ have possible delays when random adds are performed. The KSAMU┆ 0x2b50…2d1e 54 49 4c 20 70 72 6f 67 72 61 6d 20 70 72 6f 6d 70 74 73 20 74 68 65 20 6f 70 65 72 61 74 6f 72 20 66 6f 72 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 69 74 65 6d 73 3a 0d 0d 09 31 2e 20 27 ┆TIL program prompts the operator for the following items: 1. '┆ 0x2b50…2d1e 45 4e 54 45 52 20 55 54 49 4c 49 54 59 20 ┆ENTER UTILITY ┆ 0x2d1e…2eec (25,) 46 55 4e 43 54 49 4f 4e 27 20 2d 20 45 6e 74 65 72 20 4c 4f 41 44 2e 0d 09 32 2e 20 27 45 4e 54 45 52 20 46 49 4c 45 20 4e 41 4d 45 3a 27 2e 0d 09 33 2e 20 27 45 4e 54 45 52 20 53 45 51 55 45 ┆FUNCTION' - Enter LOAD. 2. 'ENTER FILE NAME:'. 3. 'ENTER SEQUE┆ 0x2d1e…2eec 4e 54 49 41 4c 20 49 4e 50 55 54 20 46 49 4c 45 3a 27 2e 0d 0d 09 44 2e 20 55 4e 4c 4f 41 44 20 2d 20 55 6e 6c 6f 61 64 69 6e 67 20 61 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 09 54 68 65 20 4b ┆NTIAL INPUT FILE:'. D. UNLOAD - Unloading a KSAM file. The K┆ 0x2d1e…2eec 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 77 69 6c 6c 20 75 6e 6c 6f 61 64 20 61 20 4b 53 41 4d 20 66 69 6c 65 20 61 6e 64 20 70 6c 61 63 65 20 74 68 65 20 64 61 74 61 20 69 6e 20 61 20 ┆SAMUTIL program will unload a KSAM file and place the data in a ┆ 0x2d1e…2eec 73 65 71 75 65 6e 74 69 61 6c 20 66 69 6c 65 20 69 6e 20 61 73 63 65 6e 64 69 6e 67 20 6b 65 79 20 6f 72 64 65 72 2e 20 20 54 68 65 20 4b 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 70 72 ┆sequential file in ascending key order. The KSAMUTIL program pr┆ 0x2d1e…2eec 6f 6d 70 74 73 20 74 68 65 20 6f 70 65 72 61 74 6f 72 20 66 6f 72 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 69 74 65 6d 73 3a 0d 0d 09 31 2e 20 27 45 4e 54 45 52 20 55 54 49 4c 49 54 59 20 ┆ompts the operator for the following items: 1. 'ENTER UTILITY ┆ 0x2d1e…2eec 46 55 4e 43 54 49 4f 4e 3a 27 20 2d 20 45 6e 74 65 72 20 55 4e 4c 4f 41 44 2e 0d 09 32 2e 20 27 45 4e 54 45 52 20 46 49 4c 45 20 4e 41 4d 45 3a 27 2e 0d 09 33 2e 20 27 45 4e 54 45 52 20 53 45 ┆FUNCTION:' - Enter UNLOAD. 2. 'ENTER FILE NAME:'. 3. 'ENTER SE┆ 0x2d1e…2eec 51 55 45 4e 54 49 41 4c 20 4f 55 54 50 55 54 20 46 49 4c 45 3a 27 2e 0d 0d 09 45 2e 20 42 41 4c 41 4e 43 45 20 2d 20 42 61 6c 61 6e 63 69 6e 67 20 61 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 09 ┆QUENTIAL OUTPUT FILE:'. E. BALANCE - Balancing a KSAM file. ┆ 0x2d1e…2eec 42 61 6c 61 6e 63 69 6e 67 20 6f 66 20 61 ┆Balancing of a┆ 0x2eec…30ba (26,) 20 4b 53 41 4d 20 66 69 6c 65 20 69 73 20 72 65 71 75 69 72 65 64 20 70 65 72 69 6f 64 69 63 61 6c 6c 79 20 75 6e 6c 65 73 73 20 74 68 65 20 55 70 64 61 74 69 6e 67 20 53 65 76 65 72 69 74 79 ┆ KSAM file is required periodically unless the Updating Severity┆ 0x2eec…30ba 20 49 6e 64 65 78 20 69 73 20 65 71 75 61 6c 20 74 6f 20 7a 65 72 6f 2e 20 20 54 68 65 20 6e 65 63 65 73 73 69 74 79 20 66 6f 72 20 62 61 6c 61 6e 63 69 6e 67 20 61 72 72 69 73 65 73 20 77 68 ┆ Index is equal to zero. The necessity for balancing arrises wh┆ 0x2eec…30ba 65 6e 20 74 68 65 20 65 66 66 69 63 65 6e 74 20 61 64 64 69 6e 67 20 6f 66 20 72 65 63 6f 72 64 73 20 69 73 20 61 20 73 79 73 74 65 6d 20 72 65 71 75 69 72 65 6d 65 6e 74 20 61 6e 64 20 74 68 ┆en the efficent adding of records is a system requirement and th┆ 0x2eec…30ba 65 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 20 6f 66 20 61 64 64 73 20 61 6e 64 20 64 65 6c 65 74 65 73 20 61 63 63 72 6f 73 73 20 74 68 65 20 65 6e 74 69 72 65 20 66 69 6c 65 20 69 73 20 6e ┆e distribution of adds and deletes accross the entire file is n┆ 0x2eec…30ba 6f 74 20 75 6e 69 66 6f 72 6d 2e 20 20 54 68 65 20 4b 53 41 4d 55 54 49 4c 20 70 72 6f 67 72 61 6d 20 77 69 6c 6c 20 70 72 6f 6d 70 74 20 74 68 65 20 6f 70 65 72 61 74 6f 72 20 66 6f 72 20 74 ┆ot uniform. The KSAMUTIL program will prompt the operator for t┆ 0x2eec…30ba 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 69 74 65 6d 73 3a 0d 0d 09 31 2e 20 27 45 4e 54 45 52 20 55 54 49 4c 49 54 59 20 46 55 4e 43 54 49 4f 4e 3a 27 20 2d 20 45 6e 74 65 72 20 42 41 4c 41 4e ┆he following items: 1. 'ENTER UTILITY FUNCTION:' - Enter BALAN┆ 0x2eec…30ba 43 45 2e 0d 09 32 2e 20 27 45 4e 54 45 52 20 46 49 4c 45 20 4e 41 4d 45 3a 27 2e 0d 09 33 2e 20 27 45 4e 54 45 52 20 53 45 51 55 45 4e 54 49 41 4c 20 53 43 52 41 54 43 48 20 46 49 4c 45 3a 27 ┆CE. 2. 'ENTER FILE NAME:'. 3. 'ENTER SEQUENTIAL SCRATCH FILE:'┆ 0x2eec…30ba 2e 0d 0d 09 54 68 65 20 73 65 71 75 65 6e ┆. The sequen┆ 0x30ba…3288 (27,) 74 69 61 6c 20 73 63 72 61 74 63 68 20 66 69 6c 65 20 6d 75 73 74 20 62 65 20 6c 61 72 67 65 20 65 6e 6f 75 67 68 20 74 6f 20 68 6f 6c 64 20 74 68 65 20 65 6e 74 69 72 65 20 63 6f 6e 74 65 6e ┆tial scratch file must be large enough to hold the entire conten┆ 0x30ba…3288 74 73 20 6f 66 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 09 46 2e 20 52 45 43 4f 56 45 52 59 20 2d 20 52 65 63 6f 76 65 72 69 6e 67 20 61 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 09 54 ┆ts of the KSAM file. F. RECOVERY - Recovering a KSAM file. T┆ 0x30ba…3288 68 65 20 52 45 43 4f 56 45 52 59 20 66 75 6e 63 74 69 6f 6e 20 70 72 65 66 6f 72 6d 73 20 69 6e 20 74 68 65 20 73 61 6d 65 20 6d 61 6e 6e 6f 72 20 61 73 20 74 68 65 20 55 4e 4c 4f 41 44 20 66 ┆he RECOVERY function preforms in the same mannor as the UNLOAD f┆ 0x30ba…3288 75 6e 63 74 69 6f 6e 20 77 69 74 68 20 74 68 65 20 61 64 64 20 66 65 61 74 75 72 65 20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 74 72 79 20 74 6f 20 73 61 6c 76 61 67 65 20 61 6c 6c 20 72 65 63 ┆unction with the add feature that it will try to salvage all rec┆ 0x30ba…3288 6f 67 6e 69 7a 61 62 6c 65 20 64 61 74 61 2e 20 20 52 45 43 4f 56 45 52 59 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 20 75 73 65 64 20 61 73 20 61 20 73 75 62 73 74 69 74 75 74 65 20 66 6f 72 ┆ognizable data. RECOVERY should not be used as a substitute for┆ 0x30ba…3288 20 55 4e 4c 4f 41 44 20 64 75 65 20 74 6f 20 74 68 65 20 69 6e 65 66 66 69 63 65 6e 63 79 20 6f 66 20 52 45 43 4f 56 45 52 59 2e 20 20 54 68 65 20 6f 70 65 72 61 74 6f 72 20 65 6e 74 65 72 73 ┆ UNLOAD due to the inefficency of RECOVERY. The operator enters┆ 0x30ba…3288 20 74 68 65 20 73 61 6d 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 61 73 20 69 6e 20 74 68 65 20 55 4e 4c 4f 41 44 20 66 75 6e 63 74 69 6f 6e 2e 0d 0d 09 47 2e 20 4d 41 50 20 2d 20 50 72 69 6e ┆ the same information as in the UNLOAD function. G. MAP - Prin┆ 0x30ba…3288 74 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 ┆t information ┆ 0x3288…3456 (28,) 63 6f 6e 63 65 72 6e 69 6e 67 20 62 61 6c 61 6e 63 69 6e 67 2e 0d 0d 09 54 68 65 20 4d 41 50 20 66 75 6e 63 74 69 6f 6e 20 70 72 69 6e 74 73 20 73 74 61 74 69 73 74 69 63 73 20 63 6f 6e 63 65 ┆concerning balancing. The MAP function prints statistics conce┆ 0x3288…3456 72 6e 69 6e 67 20 74 68 65 20 61 6d 6f 75 6e 74 20 61 6e 64 20 64 69 73 74 72 69 62 75 74 69 6f 6e 20 6f 66 20 61 64 64 73 20 61 6e 64 20 64 65 6c 65 74 65 73 2e 0d 0d 09 31 2e 20 27 45 4e 54 ┆rning the amount and distribution of adds and deletes. 1. 'ENT┆ 0x3288…3456 45 52 20 55 54 49 4c 49 54 59 20 46 55 4e 43 54 49 4f 4e 3a 27 20 2d 20 45 6e 74 65 72 20 4d 41 50 2e 0d 09 32 2e 20 27 45 4e 54 45 52 20 46 49 4c 45 20 4e 41 4d 45 3a 27 2e 0c 01 cd 1e 00 21 ┆ER UTILITY FUNCTION:' - Enter MAP. 2. 'ENTER FILE NAME:'. !┆ 0x3288…3456 00 43 7e fe 2c 0e 01 cc 1e 00 cd 1b 00 97 d3 01 cd 24 00 3e 01 32 98 40 0e 18 21 d0 40 11 54 45 52 20 53 45 51 55 45 4e 54 49 41 4c 20 53 43 52 41 54 43 48 20 46 49 4c 45 3a 27 2e 0d 0d 09 54 ┆ C~ , $ > 2 @ ! @ TER SEQUENTIAL SCRATCH FILE:'. T┆ 0x3288…3456 68 65 20 73 65 71 75 65 6e 74 69 61 6c 20 73 63 72 61 74 63 68 20 66 69 6c 65 20 6d 75 73 74 20 62 65 20 6c 61 72 67 65 20 65 6e 6f 75 67 68 20 74 6f 20 68 6f 6c 64 20 74 68 65 20 65 6e 74 69 ┆he sequential scratch file must be large enough to hold the enti┆ 0x3288…3456 72 65 20 63 6f 6e 74 65 6e 74 73 20 6f 66 20 74 68 65 20 4b 53 41 4d 20 66 69 6c 65 2e 0d 0d 09 46 2e 20 52 45 43 4f 56 45 52 59 20 2d 20 52 65 63 6f 76 65 72 69 6e 67 20 61 20 4b 53 41 4d 20 ┆re contents of the KSAM file. F. RECOVERY - Recovering a KSAM ┆ 0x3288…3456 66 69 6c 65 2e 0d 0d 09 54 68 65 20 52 45 43 4f 56 45 52 59 20 66 75 6e 63 74 69 6f 6e 20 70 72 65 66 6f 72 6d 73 20 69 6e 20 74 68 65 20 73 61 6d 65 20 6d 61 6e 6e 6f 72 20 61 73 20 74 68 65 ┆file. The RECOVERY function preforms in the same mannor as the┆ 0x3288…3456 20 55 4e 4c 4f 41 44 20 66 75 6e 63 74 69 ┆ UNLOAD functi┆