
CREATE_USER_INDEX procedure
The CREATE_USER_INDEX 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.
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.
- key-length
- An integer value that specifies the length of the key to be used for any insertions into the user index.
- 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.
- 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.
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');
