Manipulating a user space without pointers

When programming in a high-level language that does not support pointers, you can use the Change User Space (QUSCHGUS) and Retrieve User Space (QUSRTVUS) APIs to manipulate data. However, you must first understand how to use positions and lengths with these APIs.

Position values

Some APIs return offset values into a user space. To use other APIs, such as the Retrieve User Space (QUSRTVUS) API, you must use position values to locate bytes.

Position values and offset values are different ways to express the same thing. An offset value is the relative distance of a byte from the first byte of the user space, which has an offset value of 0. A position value is the offset value plus 1.

Lengths

List APIs return the length of the information in the different sections of the user space, as well as the length of the list entries in the user space. You need to code your application using the lengths returned instead of specifying the current length that is returned by the API or the size of a data structure in the data structure files. The amount of information returned for any format might increase in future releases, but the information will be placed at the end of the existing information. To function properly, your application should retrieve the length of the information that is returned and add that length to a pointer or to a starting position.

Using offset values with the change and retrieve user space APIs

When you use the Change User Space (QUSCHGUS) or Retrieve User Space (QUSRTVUS) API, your application program should first retrieve the offset value for the information you want. You must then add one to the offset value to get the starting position for the information.