CREATE_USER_SPACE procedure
The CREATE_USER_SPACE procedure creates or replaces a user space (*USRSPC) object.
The values used by the procedure are closely related to the values handled by the Create User Space (QUSCRTUS) API.
Authorization: The caller must have:
- *READ and *ADD authority to the library where the user space is being created.
- If a user space is being replaced, the caller must have *OBJMGT, *OBJEXIST, and *READ authorities to the existing user space.
The schema is QSYS2.
- user-space
- A character string containing the name of the user space to be created.
- user-space-library
- A character string containing the name of the library where the user space is to be created. Can
be the following special value:
- *CURLIB
- The job's current library is used.
- size
- The initial size of the user space being created. This value must be from 1 byte to 16,773,120
bytes.
The size of the user space that is created could be larger than the specified value.
- replace
- A character string that indicates whether an existing user space by this name is to be replaced.
- NO
- Do not replace an existing user space of the same name and library. This is the default.
- YES
- Replace an existing user space of the same name and library.
- text-description
- A character string that describes the user space. It can be up to 50 characters long.
- public-authority
- The authority given to a newly created user space for users who do not have a specific private
or group authority to the user space. This option is ignored if replace has a value of YES
and an existing user space is replaced.
- *ALL
- The public authority allows users to perform all operations on the user space.
- authorization-list-name
- The user space is secured by the specified authorization list, and its public authority is set to *AUTL.
- *CHANGE
- The public authority allows users to read the object description and provides read, add, update, and delete authority to the user space.
- *EXCLUDE
- The public authority prevents users from accessing the user space 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 user space.
- extendable
- A character string that indicates whether the user space can be automatically extended.
- NO
- The user space is not automatically extendable. The user space maximum size matches the initial size.
- YES
- The user space is automatically extendable. The size of the user space automatically grows as data is written beyond its current size. This is the default.
- initial-value
- The initial value of all bytes in the user space as a binary value. A value of BX'00' will achieve the best performance. This is the default.
- object-attribute
- A character string that specifies the user-provided object attribute to assign to the user space. It can be up to ten characters long. The string will be folded to uppercase.
- transfer-size
- An integer value that indicates the number of pages to be transferred between main storage and auxiliary storage. This is only a request, as system processing can use a value of its choice in some circumstances. Allowable values are from 0 to 32 pages. A value of 0 indicates that the default transfer size for the user space should be used. The default is 0.
- object-domain
- The domain into which the user space is created.
- *DEFAULT
- The system decides into which domain the object should be created. This is the default.
- *SYSTEM
- Create the user space object into the system domain.
- *USER
- Attempt to create the user space object into the user domain.
Example
- Create user space USRSPC1 in APPLIB with an initial size of 1000 bytes. Assign *EXCLUDE public
authority to the *USRSPC object.
CALL QSYS2.CREATE_USER_SPACE(USER_SPACE => 'USRSPC1', USER_SPACE_LIBRARY => 'APPLIB', SIZE => 1000, PUBLIC_AUTHORITY => '*EXCLUDE');