The program KSAMUTIL provides MPE capabilities that allow you to manipulate KSAM files. With KSAMUTIL commands, you can create a KSAM file, rename both the data and key files, save a temporary file as a permanent file, clear all data from a file, purge a file, and verify the contents and access history of an existing file.
The HP 3000 file copier, FCOPY, is adapted to copy KSAM files. FCOPY allows you to copy from a KSAM file to another file (KSAM or non-KSAM), in primary or alternate key sequence; to copy an entire file or a subset of a file, and to copy either the data or key file.
The MPE commands :STORE and :RESTORE can be used with KSAM files to transfer the files
from disc to magnetic tape and vice versa.
The utility functions that can be performed on KSAM files are summarized in Table 2-1 “Summary of KSAM Utilities”.
Both KSAMUTIL and FCOPY are programs resident in the system library that can be executed with the MPE :RUN command. When run in a session, each program responds by issuing a greater-than (>) prompt. You may then enter commands to control further operation of the program. Both programs may be operated in batch mode as well as in a session. In batch mode, the greater-than prompt is not required. :STORE and :RESTORE are commands directed to the MPE command interpreter and can be included in either a job or a session.
Table 2-1 Summary of KSAM Utilities
UTILITY | OPTION/COMMAND | FUNCTION |
---|
KSAMUTIL | >BUILD or >B | Create KSAM file consisting of a data file and key file. |
| >ERASE | Clear contents of KSAM data file and reset key file pointers. |
| >PURGE | Remove KSAM file from system. |
| >RENAME or >R | Change name of KSAM key or data file to a new name. |
| >SAVE or >S | Save session/job temporary KSAM file as a permanent file. |
| >VERIFY or >V | Display information on current status of data and keys in KSAM file. |
| >HELP or >H | Request description of KSAMUTIL commands. |
| >EXIT or >E | Exit from KSAMUTIL program. |
| >KEYSEQ or >KS | Check the sequence of any key (primary or alternate) in key file. |
| >KEYDUMP or >KD | Display a formatted, structural key file dump. |
| >KEYINFO or >K1 | Display information on current status of key file; in case of system failure, attempt recovery. |
FCOPY | ;KEY=keylocation | Copy KSAM file in key sequence by a key specified by its beginning location in record. |
| ;NOKSAM | Copy contents of key or data file in consecutive (physical) order. |
| | If both these parameters are omitted, the data file is copied in sequence by primary key; the key file
is established with all links maintained. Other FCOPY options apply to KSAM files with minor
exceptions (refer to Table 2-4 “FCOPY Functions with KSAM Files”). |
MPE | :STORE datafile, keyfile | Store KSAM data and key files from disc to magnetic tape. |
| :RESTORE datafile, keyfile | Restore KSAM data and key files from magnetic tape. |