Using the Repository subroutine library

The subroutines in the Repository subroutine library provide read‑only access to Repository information about structures, enumerations, files, templates, fields, keys, relations, formats, tags, and aliases. Most of these subroutines have more than one function, which enables them to obtain a variety of data.

Requirements

To use the Repository subroutine library you must do the following:

The ddinfo.def file

Note

You can use the ddinfo.def file for informational purposes, but you should not change its contents. This file is distributed in your rps\lib directory.

Your calling program and the Repository subroutines communicate with each other through ddinfo.def, which contains definitions of the function codes, flags, and record layouts used by the subroutine library. One of these record layouts is the repository control structure (dcs), which is passed to all Repository subroutines as the first argument. The first two bytes of the control structure hold the error code that is set by each subroutine. You should check the error code after each subroutine returns. It will be zero if no error has occurred.

You can include and exclude parts of ddinfo.def by using DDINFO_DEFINES_ONLY and DDINFO_INGLOBAL:

You can change the way data structures are included by using DDINFO_STRUCTURE:

Defining DDINFO_STRUCTURE also affects how arrays within data structures are handled. When DDINFO_STRUCTURE is defined, arrays within data structures are defined as real arrays, because pseudo arrays are not allowed within a STRUCTURE statement. When DDINFO_STRUCTURE is not defined, arrays within data structures are defined as pseudo arrays for compatibility with existing code.