Start of change

CHANGE_USER_SPACE and CHANGE_USER_SPACE_BINARY procedures

The CHANGE_USER_SPACE and CHANGE_USER_SPACE_BINARY procedures change the contents of a user space (*USRSPC) object by writing a specified amount of data to the object at a specified location. The data can be provided as either character or binary data.

The values used by the procedures are closely related to the values handled by the Change User Space (QUSCHGUS) API.

Authorization: The caller must have:
  • *EXECUTE authority to the library containing the user space, and
  • *CHANGE authority to the user space.
Read syntax diagramSkip visual syntax diagramCHANGE_USER_SPACECHANGE_USER_SPACE_BINARY( USER_SPACE => user-space,USER_SPACE_LIBRARY => user-space-library,DATA => data,START_POSITION => start-position,FORCE => force)

The schema is QSYS2.

user-space
A character string containing the name of the user space to be changed.
user-space-library
A character string containing the name of the library containing the user space to be changed. Can be one of the following special values:
*CURLIB
The job's current library is used.
*LIBL
The library list is used.
data
The data to be written to the user space. The string can be up to 16,773,120 bytes long.
  • For CHANGE_USER_SPACE, the input value will be converted to a character string using the job CCSID.
  • For CHANGE_USER_SPACE_BINARY, the input value will be considered a binary string.
start-position
An integer value that indicates the position in the user space where data will be written. The first position in the user space is position 1. If this parameter is omitted, 1 will be used.
force
A character string that indicates whether changes made to the user space should be forced to auxiliary storage.
ASYNC
Force changes asynchronously. This interrupts normal system management and ensures that the user space is written to auxiliary storage.
NO
Do not force changes. Normal system management writes the changes to auxiliary storage. This is the default.
SYNC
Force changes synchronously. This interrupts normal system management and ensures that the user space is written immediately to auxiliary storage.

Example

  • Modify the content of user space USRSPC1 in APPLIB, placing the specified string starting at the 500th byte in the space.
    CALL QSYS2.CHANGE_USER_SPACE(USER_SPACE => 'USRSPC1', 
                                 USER_SPACE_LIBRARY => 'APPLIB', 
                                 DATA => 'Overwrite with this new value', 
                                 START_POSITION => 500);
    
End of change