Hitachi

JP1 Version 12 JP1/Base User's Guide


Jiskeymnt

Organization of this page

Function

The Jiskeymnt command adds or deletes keys. The Jiskeymnt command also reorganizes the key file. The key definition parameter file specifies the keys to be added, deleted or reorganized. Use a text editor or the vi editor (in UNIX) to create the key definition parameter file.

Adding keys

This command adds key item names and key definitions to the key definition file. This command also creates the key file for the keys to be added.

Deleting keys

This command deletes key item names and key definitions from the key definition file. This command also deletes the key file for the keys to be deleted.

Reorganizing keys

This command uses the current key definitions to re-create the key file for the specified keys.

Format

In Windows:

Jiskeymnt file-name

In UNIX:

Jiskeymnt [file-name ...]

Required execution permission

In Windows: Administrators (If User Account Control (UAC) for Windows is enabled, you must execute the command from the administrator console.)

In UNIX: Superuser or JP1/Base administrator permission

Command directory

In Windows:

installation-folder\bin\

In UNIX:

/opt/jp1base/bin/

Arguments

file-name

Specify the name of the key definition parameter file containing the information about the ISAM file for which you want to add, delete or reorganize keys.

In Windows, if you want to specify a file name that includes spaces, enclose the file name in double quotation marks (").

In UNIX, you can omit a file name. If you omit a file name, the command imports the key definitions for the ISAM file from the standard input. When you specify more than one file name, use at least one space to separate each file name. You can also use the wildcard character (*) to specify files.

Example:

The following shows examples in Windows.

  • Specify all the files in the c:\data directory.

Jiskeymnt c:\data\*
  • Specify all the file names beginning with SAMPLE in the c:\data directory.

Jiskeymnt c:\data\SAMPLE*

Creating the key definition parameter file

The following shows how to create the key definition parameter file.

Items to be specified in the file

The following table shows the items you need to specify in the key definition parameter file.

Table 15‒6: Items in the key definition parameter file (for adding, deleting and reorganizing keys)

Keyword

Format

Contents

fi-

file-name#1

Specify the name of an ISAM file. You can include a path name in the file name. Follow the file naming rules of the OS you are using.

In Windows, if the file name includes spaces, enclose the file name in double quotation marks (").

In UNIX, the maximum number of characters you can use in file-name is four characters fewer than the maximum file name length of the OS.

an-

key-item-name#2

Specify a key item name when you add a key.

dn-

key-item-name#2

Specify a key item name when you delete a key.

rn-

key-item-name#2

Specify a key item name when you reorganize a key. If you want to reorganize all keys, omit key-item-name.

ke-

t=key-attribute

,p=key-position

,l=key-length

[,ISDESC]

Specify the details of a key when you add a key. You must specify this keyword when adding a key. When you want to specify a compound key, you must specify this keyword for each constituent element in the compound key.#3

key-attribute

In key-attribute, specify any of the following keywords:

c for character type (CHARTYPE)

i for two-byte integer type (INTTYPE)

l for four-byte integer type (LONGTYPE)

f for floating type (FLOATTYPE)

d for double length type (DOUBLETYPE)

key-position

The value to be specified in key-position differs depending on the record type.

Fixed-length record type:0 to (record-length - 1)

Variable-length record type:0 to (minimum-record-length - 1)

key-length

The value to be specified in key-length differs depending on the key attribute.

c (CHARTYPE): 1 to 255

i (INTTYPE): 2

l (LONGTYPE): 4

f (FLOATTYPE): 4

d (DOUBLETYPE): 8

ISDESC

Indicates that key elements are in descending order. Omitting this keyword indicates that key elements are in ascending order.

cp-

Information about key duplication and compression

When you want to add a key, use four hexadecimal numbers to specify the information about key duplication and compression.

Bit 15 specifies whether to assure the creation order of keys

if key values are duplicated.

0: Assures the creation order.

1: Does not assure the creation order.

Bit 14 specifies whether or not a sparse key exists.

0: A sparse key does not exist.

1: A sparse key exists.

In Windows: Bits 1 to 13 are reserved bits and set to

(0000000000)2.

In UNIX: Bits 4 to 13 are reserved bits and set to

(0000000000)2.

In UNIX: Bits 1 to 3 specify the compression level#4

(111)2: Performs complete compression.

(000)2: Does not compress.

Bit 0 specifies whether to permit duplicate keys.

0: Does not permit duplicate keys.

1: Permits duplicate keys.

sp-

Sparse character

When you add a key, use two hexadecimal numbers to specify the internal value of the sparse character. Specify this parameter only when you specify the cp parameter.

#1: You cannot specify a file name that ends with .KDF, .DRF or .K01 to .K99.

#2: You can use no more than 31 bytes to specify each key item name. You cannot specify K01 to K99 as a key item in the an- parameter.

#3: You cannot specify more than one constituent element whose key attribute, key position, key length and key order (ISDESC) are the same.

#4: In this type of management for ISAM files, keys are compressed regardless of the compression level.

In the key definition parameter file, the specifications of the keys to be added, the keys to be deleted and the keys to be reorganized can coexist. You can specify more than one key for each operation type.

Specifying parameters

The following shows how to specify parameters in the key definition parameter file.

[Figure]

Notes on parameter specification

Remember the following points when you specify parameters in the key definition parameter file.

  • Use at least one space to separate each parameter.

    Example:

    fi-isamfile[Figure]rn-subkey1[Figure]...

    (Legend) [Figure]: Space

  • You cannot place a space in a parameter.

    Example:

    ke-t=c[Figure],p=10...

    (Legend) [Figure]: Space

Notes

Return values

0

Normal end

1

Abnormal end