Examples: Retrieving a file description to a user space

These programming examples show an application that uses a user space as a receiver variable by retrieving a file description to a user space. This approach is possible only if you use an HLL that is able to work with pointers.

The application accepts the following parameters:

Note: Read the Code license and disclaimer information for important legal information.

The following shows the sequence of steps to retrieve a file description to a user space:

  1. The application creates a user space to store the data in, changes the user space to be automatically extendable, and retrieves a pointer to the user space.
  2. The application calls the Retrieve File Description API to retrieve the file definition template and uses the user space as the receiver variable.

This example uses an automatically extended user space as the receiver variable on a retrieve API. A user space can return a varying amount of information depending on the file description being retrieved. The user space is automatically extended up to 16MB to accommodate the information being retrieved.

Related reference
Retrieve Database File Description (QDBRTVFD)