Examples: Retrieving a file description to a user space

These examples show a high-level language program that uses a user space as a receiver variable by retrieving a file description to a user space. Use this approach only when your high-level language supports pointers.

The program accepts the following parameters:

  • User space name and library
  • File name and library
  • Record format

Here is the sequence of steps to retrieve a file description to a user space:

  1. The program 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 program calls the Retrieve File Description API to retrieve the file definition template and uses the user space as the receiver variable.

These examples use 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.