Progress/400
Product Guide
User Space Support
A user space is a permanent object that consists of a collection of bytes used for storing user-defined information. Progress/400 uses user spaces to store large amounts of data and pass this data from job to job or from system to system. Progress/400 allows you to perform operations on user spaces from within a Progress client session. You can perform two types of operations:
Using these APIs insulates your code from possible changes to the underlying method of changing and retrieving data from user spaces and provides a standard interface that does not change. You use them in the same way regardless of whether the code is being run from the remote client or from the native clients.
Progress/400 supports the change and retrieve operations by providing the QUSRSPC table definition in the Progress/400 schema. This table is similar to the QCMD table in that it controls the function of the Progress/400 DataServer, but different in that information can be changed in and retrieved from QUSRSPC.
NOTE: Do not use the QUSRSPC name as a physical file name: the SYNC function updates the file on the client, making the user space APIs unusable.Note that if you retrieve numeric data or pointers stored in the user space, you must use the SUBSTRING function on the contents of the returned buffer in order to display the data. This is because if Progress encounters a null within the returned numeric or pointer data, it interprets this as the end of the buffer and no further information is displayed. For additional information on using the SUBSTRING function, see the "Using the LOOKUP and SUBSTRING Functions with Send Data" section.
Before you can place information into a user space, you must create the user space using the OS/400 Create User Space (QUSCRTUS) command. For detailed information about OS/400 user space access routines, see the IBM OS/400 System API Reference .
Progress displays error messages in the Progress client session, and more detailed information might be available in the OS/400 job log.
CHANGE USER SPACE (chguspc.p) API
Table 11–13 describes the parameters that you must pass to the CHANGE USER SPACE API. You can use the same variable names or names of your own choice. Note that you must pass all of these parameters to the API, and they must be in the same order as in Table 11–13.
The following example illustrates calling the CHANGE USER SPACE API from your code:
To verify that an entry has been changed, check the value of the OUTPUT parameter. Table 11–14 lists possible return values.
RETRIEVE USER SPACE (rtvuspc.p) API
Table 11–15 describes the parameters that you must pass to the RETRIEVE USER SPACE API. You can use the same variable names or names of your own choice. Note that you must pass all of these parameters to the API, and they must be in the same order as in Table 11–15.
The following example illustrates calling the RETRIEVE USER SPACE API from your code:
To verify that an entry has been retrieved, check the value of the OUTPUT parameter. Table 11–16 lists possible return values.
User Space Coding Example
The following example code illustrates how to change and retrieve entries from a user space:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |