XRef Data

#### Search Results

Search

# XRef Data

XRef data is stored in the Predict system file.

XRef data documents objects of an application that have already been implemented. Data of this type mirrors the "real world" of the implementation, providing a comprehensive summary of information for all implemented members of an application.

Name references will be evaluated during cross reference analysis to reflect the functional structure in an environment you specify.

XRef data can be used to retrieve information on individual members or to retrieve comprehensive information about applications as a whole:

- its invocation structure

- the resources it uses

- its consistency, completeness and correctness.

This document covers the following topics:

- Contents of XRef Data for Natural

- Benefits of XRef Data

- Creating XRef Data for Natural Members

## Contents of XRef Data for Natural

The following information is stored for each Natural program cataloged:

- References to programs that are invoked, how they are invoked (for example `CALLNAT`, `FETCH`, `FETCH RETURN`, `PERFORM`, `RUN`, `STACK`, `SEND EVENT`, `SEND METHOD`) and the type of program (such as: main program, subroutine, subprogram, help routine, map or data area);

- References to data areas and variables, with additional information on usage of variables: use, modification or use for dynamic source code creation (described in the Natural Statements documentation in relation to the `RUN` statement). Additionally, library, DBnr and Fnr of the referenced data areas are stored.

- References to views and data area views, with additional information about their usage (for example definition in a data area, delete, read, or update);

- References to fields of views, with additional information about their usage: definition in a data area, count, read, search or update. For 3GL: precompiled by Adabas SQL Server, Adabas Native SQL;

- References to files used in the program and the type of file use (deleting, reading or updating);

- References to Natural copy code (source code), library, DBnr and Fnr of the copy codes used are stored.

- References to maps and help routines used in the program;

- References to SQL stored procedures via the Natural statement `CALLDBPROC`;

- References to Natural error numbers used in the program and the types of error messages (system-wide or application-specific);

- References to Natural printers;

- References to Natural workfiles used in the program and the type of use (whether read from, written to or close);

- References to Natural classes;

- References to Natural methods;

- References to Natural interfaces;

- References to External resources;

- References to external programs invoked from a program;

- References to entry points or functions defined in the program which can be invoked by other programs;

- References to retained sets used in the program and the type of use (build, use, or release a retained set);

- References to processing rules used in a map and their type of use (automatic, free, or inline processing rules);

- Reference to a DBRM (DB2 request module) for programs using static SQL;

- Use of EXPERT Models via the Natural statement `INVESTIGATE`;

- Use of the Natural command processor via the statement `PROCESS COMMAND`;

- Statistical information:

  - Date and time the program was cataloged/precompiled;

  - ID of the user who cataloged/precompiled the program;

  - ID of the terminal from which the program was cataloged/precompiled (in batch mode: the job name);

- Language.

## Benefits of XRef Data

The application development process can be advanced significantly at almost all phases by using XRef data:

Phase | Benefits of XRef Data
--- | ---
Design | Identifying programs of other applications that might possibly be used in the planned application.
Implementation | Finding resources that are not (or no longer) used. Finding errors and inconsistencies that cause errors at runtime, for example calls to non-existent subroutines. Supervising the implementation state of an application.
Testing | Detecting incomplete documentation. Detecting differences between design and implementation. Detecting programming errors.
Production | Reporting all information about the programs that are in production.
Maintenance | Estimating the impact of changes. Discovering the invocation structure of an application.

## Creating XRef Data for Natural Members

XRef data for Natural is generated in the following cases:

- Natural writes XRef data for Natural programs and data areas when these are cataloged (provided that the `XREF` parameter has been set to either `ON` or `FORCE`, see below). This does not affect the performance of the program; only the cataloging time is insignificantly extended.

- Natural Security writes XRef data for programs that are used as Startup, Restart or Error-Transaction in an application or special link if the `XREF` parameter is set to `ON` or `FORCE` in the application's Natural Security definition and a user system file is defined for the application.

- The Natural Command Processor (NCP) writes XRef data for programs that are used as Startup, Restart or Error-Transaction in an application or special link if the `XREF` parameter is set to `ON` or `FORCE` in the application's NCP definition and a user system file is defined for the application.

- If Natural for DB2 is installed, the function `CREATE DBRM` of Natural for DB2 creates XRef data for Natural programs that use static SQL.

The Natural `XREF` parameter determines whether XRef data is created. Valid values:

`ON` | XRef data is created when a Natural object is cataloged.
`OFF` | XRef data is not created when a Natural object is cataloged.
`FORCE` | A Natural object can only be cataloged if a Predict documentation object exists for it. XRef data is then created when cataloging an object.
`DOC` | A Natural object can only be cataloged if a Predict documentation object exists for it. No XRef data is created.

There are different ways to set the Natural XREF parameter:

- In the Natural parameter module.

- As a dynamic parameter when starting a Natural session.

- In Natural Security. If Natural Security has been used to set the `XREF` parameter, the `XREF` command may only be used to enforce this setting (from `ON` to `FORCE`, from `OFF` to `ON` or `FORCE`).

- With the Natural `XREF` command. If Natural Security is not installed, the `XREF` parameter is usually set with the Natural `XREF` command. The Natural command `XREF ?` displays the current setting of the `XREF` parameter.

See the section LIST XREF for Natural in the Predict Reference documentation for a complete description of where and when XRef data for Natural members is created.

### On this page

- Contents of XRef Data for Natural
- Benefits of XRef Data
- Creating XRef Data for Natural Members