![]() |
![]() |
KSAM/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 2 USING KSAM UTILITIES![]() KEYSEQ |
|
Verifies sequence of key values in KSAM file.
This command compares all the key values in a particular key (primary or alternate) to determine whether they are in ascending sequence. If any values are out of sequence, a list of numbers identifying such values is displayed, unless NOLIST is specified. In any case, the number of outquence values is returned. Note that if key values are out of sequence, the key file is damaged and the KSAM file must be reloaded. The abbreviation KS may be used instead of the keyword KEYSEQ.
If you suspect that your key file has out of order key values in any key, you can run KEYSEQ. If any key values are not in ascending sequence, the key numbers associated with those key values are displayed. Note that the number of a key value refers to its position in the key file. For example, if the third, fourth, and fifth key values of a particular key are out of sequence, the numbers 3, 4, and 5 are displayed. If the list of out-of-sequence key numbers is long, you can terminate it by holding down the CNTL key while typing Y (CNTL/Y). The total number of out-of-sequence key values will be displayed even if you terminate the list with CNTL/Y or suppress it altogether with NOLIST. Consider the following partiallist of key values in the primary key of the KSAM file MYFILE: ![]() If you run KSAMUTIL and use the KEYSEQ command, as shown below, you can determine which keys are out of order:
KEYSEQ displays the following:
Regardless of the number of key values that are out of sequence, you should reload the KSAM file to restore its integrity. Consider a second example. Suppose MYFILE has two alternate keys, one starting in location 11 (11th character of record) and another starting in location 33. To verify the sequence of key values in the second alternate key, execute KEYSEQ as follows:
In this case all the key values were in correct sequence. Unless other keys in this file have values that are out of sequence, you need not reload the file. Note that NOLIST was specified. In general this is good practice. If any key values are not in sequence, the file should be reloaded, so it is seldom important to know which keys are out of sequence. |