Create User Index (QUSCRTUI) API


  Required Parameter Group:


  Optional Parameter Group 1:


  Optional Parameter Group 2:


  Optional Parameter Group 3:


  Optional Parameter Group 4:


  Default Public Authority: *USE

  Threadsafe: Yes

The Create User Index (QUSCRTUI) API creates a user index in either the user domain or the system domain. A system-domain user index cannot be saved to a release prior to Version 2 Release 3 Modification 0. A user-domain user index can be directly manipulated with MI instructions and can also be accessed using system APIs at all security levels. On a system with the QSECURITY system value set to 40 or greater, you must use system APIs to access system-domain user indexes. If you create a permanent object by using this API, you cannot delete the object by using the MI instruction DESINX when the system security level is set to 40 or greater. You would have to delete the object by using the Delete User Index (QUSDLTUI) API.

Note: If the user index is larger than 4 gigabytes, it cannot be saved to a release prior to Version 5 Release 2 Modification 0.

If the user index was created prior to Version 2 Release 2 Modification 0, the size of the user index is limited to a maximum of 1 gigabyte. (A user index with a size greater than 1 gigabyte cannot be saved to or restored from a release prior to Version 2 Release 2 Modification 0.) If the user index was created on or after Version 2 Release 2 Modification 0, the size of the object is limited to a maximum of 4 gigabytes. The size is dependent on the amount of storage needed for the number and size of index entries and excludes the size of the associated space, if any.

Note: You can tell whether a user index object can be saved to a release prior to Version 2 Release 2 Modification 0:

Note: For performance reasons, the *USRIDX object is created before checking to see if it exists in the library specified for the qualified user index name. If you have an application using this API repeatedly, even if you are using *NO for the replace parameter, permanent system addresses will be used.


Authorities and Locks

Library Authority
*READ and *ADD.

User Index Authority
*OBJMGT, *OBJEXIST, and *READ. These authorities are required only if the replace parameter is used and there is an existing user index to replace.

User Index Lock
*EXCL. This applies to both the user index being created and an existing user index being replaced.

Required Parameter Group

Qualified user index name
INPUT; CHAR(20)

The name of the user index being created, and the library in which it is to be located. The first 10 characters contain the user index name, and the second 10 characters contain the library name.

You can use this special value for the library name:

User indexes created in the QTEMP and QRPLOBJ libraries are not forced to permanent storage; they are deleted when those libraries are cleared at sign-off and system IPL, respectively.

Extended attribute
INPUT; CHAR(10)

The extended attribute of the user index. For example, an object type of *FILE could have an extended attribute of PF (physical file), LF (logical file), DSPF (display file), or SAVF (save file).

The extended attribute must be a valid *NAME. You can enter this parameter in uppercase, lowercase, or mixed case. The API automatically converts it to uppercase.

Entry length attribute
INPUT; CHAR(1)

Whether there are fixed-length or variable-length entries in the user index. The valid values are:


Entry length
INPUT; BINARY(4)

The length of entries in the index.

The valid values for fixed-length entries are from 1 through 2000.

Valid values for variable length entries are 0 or -1. A value of 0 enables a maximum entry length of 120 bytes and a key length from 1 through 120. A value of -1 enables a maximum entry length of 2000 and a key length from 1 through 2000.

Note: A user index created with an entry length greater than 120 cannot be saved or restored to a release prior to Version 2 Release 2 Modification 0.

Key insertion
INPUT; CHAR(1)

Whether the inserts to the index are by key. The valid values are:


Key length
INPUT; BINARY(4)

The length of the key where the first byte of an entry is the beginning of the key for the index entries. The value for this parameter must be 0 for no insertion by key. If you specify key length insertion, this value is from 1 through 2000.

Immediate update
INPUT; CHAR(1)

Whether the updates to the index are written to auxiliary storage on each update to the index. The valid values are:

Optimization
INPUT; CHAR(1)

The type of access in which to optimize the index. The valid values are:


Public authority
INPUT; CHAR(10)

The authority you give to users who do not have specific private or group authority to the user index. Once the user index has been created, its public authority stays the same when it is moved to another library or restored from backup media.

If the replace parameter is used and an existing user index is replaced, this parameter is ignored. All authorities are transferred from the replaced user index to the new one.

The valid values for this parameter are:


Text description
INPUT; CHAR(50)

A brief description of the user index.


Optional Parameter Group 1

Replace
INPUT; CHAR(10)

Whether you want to replace an existing user index. Valid values for this parameter are:

If the user index already exists, you can replace it with a new user index of the same name and library. The new user index is subject to the same authorities. The user index being replaced is destroyed if both:

  • The allow user domain (QALWUSRDMN) system value is not set to *ALL or does not contain the QRPLOBJ library.
  • The user index you are replacing is in the user domain.

If the user index is in the system domain, it is moved to the QRPLOBJ library. If QALWUSRDMN is set to *ALL or if it contains QRPLOBJ, the replaced user index is moved to QRPLOBJ, which is cleared at system IPL. For details about authorities, ownership, and renaming, see the discussion of the REPLACE parameter in the Control language topic collection.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter. If this parameter is omitted, diagnostic and escape messages are issued to the application.


Optional Parameter Group 2

Domain
INPUT; CHAR(10)

The domain into which the user index should be created. If this parameter is not specified, the value of *DEFAULT will be assumed by the API. Valid values for this parameter are:

The API uses the following criteria to determine into which domain to create the user index. The destination library is the library you specified in the qualified user index name parameter. The optional domain parameter is the information specified in the domain parameter.

If your system is at security level 40 or greater, you must use APIs to access system-domain user indexes using APIs. You cannot use MI instructions to directly access system-domain user indexes.

You can use the Retrieve Object Description (QUSROBJD) API or the List Object (QUSLOBJ) API to determine into which domain the user index object was created.


Optional Parameter Group 3

Usage tracking
INPUT; CHAR(1)

The usage tracking state. Usage tracking provides machine checkpoints to improve availability of user indexes. If a user index is found to be a state of partial change, it will be marked as damaged. The valid values are:


Optional Parameter Group 4

Index size option
INPUT; CHAR(1)

The maximum size of the user index. The valid values are:


Dependencies between Parameters

Some of the parameters are interdependent and are shown in the following table:



Error Messages



API introduced: V1R3

[ Back to top | Object APIs | APIs by category ]