Start of change

CREATE_USER_INDEX procedure

The CREATE_USER_INDEX table procedure creates or replaces a user index (*USRIDX) object.

The values used by the procedure are closely related to the values handled by the Create User Index (QUSCRTUI) API.

Authorization: The caller must have:
  • *READ and *ADD authority to the library where the user index is being created.
  • If a user index is being replaced, the caller must have *OBJMGT, *OBJEXIST, and *READ authorities to the existing user index.
Read syntax diagramSkip visual syntax diagramCREATE_USER_INDEX( USER_INDEX => user-index,USER_INDEX_LIBRARY => user-index-library,ENTRY_TYPE => entry-type,MAXIMUM_ENTRY_LENGTH => maximum-entry-length,KEY_LENGTH => key-length,INDEX_SIZE => index-size,REPLACE => replace,INDEX_ATTRIBUTE => index-attribute,OPTIMIZATION => optimization,IMMEDIATE_UPDATE => immediate-update,TRACK_USAGE => track-usage,TEXT_DESCRIPTION => text-description,PUBLIC_AUTHORITY => public-authority,OBJECT_DOMAIN => object-domain)

The schema is QSYS2.

user-index
A character string containing the name of the user index to be created.
user-index-library
A character string containing the name of the library where the user index is to be created. Can be the following special value:
*CURLIB
The current library is used.
entry-type
A character string that indicates the type of entries for the user index.
FIXED
Fixed-length entries.
VARIABLE
Variable-length entries.
maximum-entry-length
An integer value that specifies the length of entries in the user index.
When entry-type is FIXED, valid values are 1 to 2000.
When entry-type is VARIABLE, this parameter is ignored and the value 2000 is used.
key-length
An integer value that specifies the length of the key to be used for any insertions into the user index.
To define a non-keyed index, the value must be 0. This is the default.
To define a keyed index, the value can be 1 to maximum-entry-length.
index-size
A character string that indicates the maximum size of the user index.
4 GB
The maximum size of the user index is 4 gigabytes. This is the default.
1 TB
The maximum size of the user index is 1 terabyte.
replace
A character string that indicates whether an existing user index by this name is to be replaced.
NO
Do not replace an existing user index of the same name and library. This is the default.
YES
Replace an existing user index of the same name and library.
If the user index already exists, it is replaced by a new user index with the same name and library and keeps the original object's authorities.
index-attribute
A character string that specifies the user-provided object attribute to assign to the user index. It can be up to ten characters long. The string will be folded to uppercase.
optimization
The optimization method used for user index maintenance.
RANDOM
Optimize for random references. This is the default.
SEQUENTIAL
Optimize for sequential references.
immediate-update
Whether the updates to the index are written to auxiliary storage on each update to the index.
NO
No immediate update. This is the default.
YES
Immediate update.
track-usage
The usage tracking setting for the user index. Usage tracking provides machine checkpoints to improve recognition that the index is bad. If a user index is found to be a state of partial change, it will be marked as damaged.
NO
Do not track usage. This is the default.
YES
Track usage.
text-description
A character string that describes the user index. It can be up to 50 characters long.
public-authority
The authority given to a newly created user index for users who do not have a specific private or group authority to the user index. This option is ignored if replace has a value of YES and an existing user index is replaced.
*ALL
The public authority allows users to perform all operations on the user index.
authorization-list-name
The user index is secured by the specified authorization list, and its public authority is set to *AUTL.
*CHANGE
The public authority provides users read, add, update, and delete authority for the user index and they can read the object description.
*EXCLUDE
The public authority prevents users from accessing the user index in any way.
*LIBCRTAUT
The public authority is taken from the CRTAUT value for the library when the object is created. This is the default.
*USE
The public authority allows users to read the object description and contents but they cannot change the user index.
object-domain
The domain into which the user space is created. Refer to the API documentation for more details.
*DEFAULT
The system decides into which domain the object should be created. This is the default.
*SYSTEM
Create the user index object into the system domain.
*USER
Attempt to create the user index object into the user domain.
If the library you are creating the user index into does not appear in the QALWUSRDMN system value, the user index cannot be created into the user domain.

Example

  • Create user space USRIX1 in APPLIB to contain variable-length entries. The key is 5 characters long. Assign *EXCLUDE public authority to the *USRIDX object.
    CALL QSYS2.CREATE_USER_INDEX(USER_INDEX => 'USRIX1', 
                                 USER_INDEX_LIBRARY => 'APPLIB',
                                 ENTRY_TYPE => 'VARIABLE',
                                 KEY_LENGTH => 5, 
                                 PUBLIC_AUTHORITY => '*EXCLUDE');
    
End of change