 |
» |
|
|
|
|  |  |
The first step in understanding what KEYINFO does and why it is needed, is to understand how
KSAM end-of-files are set and maintained. Each of the two files that comprise a KSAM file (the
data Ele and the key file) has two end-of-file marks: an MPE end-of-file and a KSAM internal
end-of-file. Thus, there are four end-of-files to consider. The main characteristics of each of these
end-of-files are shown below: DATA FILE |  |
MPE End-Of-File: Number of records in fixed-length record file (or number of blocks in variable-length
record file). Stored in system file label of data file.
Recorded on disc when file is closed (or when an SPL procedure calls FCONTROL with control code 6) or when a new extent is allocated. Used by FCOPY with NOKSAM option (KSAM file is treated as an MPE file).
LISTF DATAFIL,2
ACCOUNT= MORRIS GROUP= JOAN
FILENAME CODE ------------LOGICAL RECORD----------- ----SPACE----
SIZE TYP EOF LIMIT R/B SECTORS #X MX
DATAFIL KSAM 38B FA 20 20 1 23 8 8
^
|---- MPE end-of-file for data file
|
KSAM End-of-File: Address of next available logical record in the data file. Stored in control block of key file.
Recorded on disc when file is unlocked or closed (or when an SPL procedure calls FCONTROL
with control code 2 or 6). Used by FCOPY when file is opened as a KSAM file (KEY-option). Displayed by VERIFY command (option 1) of KSAMUTIL:
:RUN KSAMUTIL.PUB.SYS
HP32208A.2.3 MON, APR 23, 1979, 1:11 PM KSAMUTIL VERSION:A.2.0
VERIFY DATAFIL
WHICH (1=FILE INFO, 2=KSAM PARAMETERS, 3=KSAM CONTROL, 4=ALL,)?1
DATAFIL.JOAN.MOPRIS CREATOR=JOAN
FOPTIONS(004005)=KSAM, :FILE, NOCCTL, F, FILENAME, ASCII, PERM
AOPTIONS(000400)=DEFAULT, NOBUF, DEFAULT, NO FLOCK, NO MR, IN
RECSIZE:SUB:TYP:LDNUM:DRT:UN.: CODE:LOGICAL PTR: END OF FILE:FILE LIMIT
-38: 3: 0: 3: 5: 0: 0: 0: 20: 20
|
KSAM end-of-file for data file--------------------
LOG. COUNT:PHYS. COUNT:BLK SZ:EXT SZ:NR EXT: LABELS:LDN : DISCARD:
1: 1: -38: 3: 8: 1: 3:00000010135:
|
Since this is a file that closed successfully, the two end-of-files coincide. KEY FILE |  |
MPE End-of-File: File limit - Number of records (sectors) allocated to file at time of creation Stored in system file label.
:LISTF KEYFIL,2
ACCOUNT= MORRIS GROUP= JOAN
FILENAME CODE ------------LOGICAL RECORD----------- ----SPACE----
SIZE TYP EOF LIMIT R/B SECTORS #X MX
KEYFIL KSAMK 128W FB 50 50 1 30 5 8
|
|
MPE end-of-file on key file
(set to file limit)
|
KSAM End-of-File Address of 1st record in next available key block. Stored in Control Block of key file. Recorded on disc when file is unlocked or closed (or when SPL procedure calls FCONTROL
with control codes 2 or 6). Used by FCOPY and KSAM procedures. Displayed by VERIFY command, option 3, of KSAMUTIL:
WHICH (1=FILE INTO, 2=KSAM PARAMETERS, 3=KSAM CONTROL, 4=ALL)?3
DATA FILE = DATAFIL VERSION= A.2.1
KEY CREATED=292/'78 10:19: 7.4 KEY ACCESS= 113/'79 13:11:45.8
KEY CHANGED= 93/'79 14:18: 7.6 COUNT START=292/'78 10:19:53.6
DATA RECS = 20 DATA BLOCKS= 19 END BLK WDS= 19
DATA BLK SZ= 19 DATA REC SZ= 38 AZCESSORS= 0
FOPEN 2 FREAD 0 FCLOSE 2
FREADDIR 0 FREADC 0 FREADBYKEY 0
FREMOVE 0 FSPACE 57 FFINDBYKEY 0
FGETINFO 3 FGETKEYINFO 1 FREADLABEL 0
FWRITELABEL 0 FCHECK 0 FFINDN 3
FWRITE 20 FUPDATE 0 FPOINT 0
FLOCK 0 FUNLOCK 0 FCONTRDL 0
FSETMODE 0
KEYBLK READ 7 KEYBLK WROTE 0 KEYBLK SPLIT 0
KEY FILE EOF 26 FREE KEY HD 0 SYSTEM FAILURE 0
|
KSAM internal end-of-file on key file
MIN PRIME 11 MAX PRIME 5 RESET DATE 3/'79
DATA FIXED TRUE DATA B/F 1 TOTAL KEYS 3
FIRST RECNUM 0 MIN RECSIZE 38
|
Since the MPE end-of-file is set to the file limit and the KSAM internal end-of-file to the next
available key block, these values never coincide until the key file is full.
|