Change User Space (QUSCHGUS) API


  Required Parameter Group:


  Optional Parameter:


  Default Public Authority: *USE

  Threadsafe: Yes

The Change User Space (QUSCHGUS) API changes the contents of the user space (*USRSPC) object by moving a specified amount of data to the object. This API allows you to change the contents of a user space if you are using either:

Note: To determine the starting position for the QUSCHGUS API, you must add 1 to the offset value. In contrast to the IBM® i list APIs, which use an offset value based on 0 for the starting position, the QUSCHGUS API uses a value based on 1. For the QUSCHGUS API, the first character in the user space is at position 1.


Authorities and Locks

Library Authority
*EXECUTE
User Space Authority
*CHANGE
User Space Lock
*EXCLRD

Required Parameter Group

Qualified user space name
INPUT; CHAR(20)

The first 10 characters contain the user space name, and the second 10 characters contain the name of the library where the user space is located. The special values supported for the library name are *LIBL and *CURLIB.

Starting position
INPUT; BINARY(4)

The first byte of the user space that is to be changed. It must have a value greater than 0.

Length of data
INPUT; BINARY(4)

The length of the new data in the input data parameter. The length must be greater than 0.

Input data
INPUT; CHAR(*)

The new data to be placed into the user space. The field must be at least as long as the length of data parameter.

Force changes to auxiliary storage
INPUT; CHAR(1)

The method of forcing changes made to the user space to auxiliary storage.

The valid values are as follows:


Optional Parameter

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.


Error Messages



API introduced: V1R3

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