List XRef for Third Generation Languages

In addition to documentation objects, which establish the metadata model of an application, XRef data is stored in Predict. XRef data document objects of an application that are already implemented. Data of this type mirror the current implementation status of an application.

This document covers the following topics:

Note:
The concepts of retrieving XRef data and some LIST XREF functions apply both to third generation languages and Natural. The detailed descriptions of the concepts and functions applying both to Natural and third generation languages are contained in the section LIST XREF for Natural. This section refers back to the previous section whenever necessary. A general description of how XRef data is created and used is contained in the section XRef Data in the Introduction to Predict documentation.


Creation of XRef Data for 3GL

XRef data for programs in third generation languages is written by different utilities:

  • By Adabas Native SQL (COBOL, FORTRAN, PL/I and ADA).

  • During precompilation with the Predict preprocessor (Assembler, COBOL and PL/I). The preprocessor is described in the section Preprocessor in the External Objects in Predict documentation.

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

  • If a 3GL program is documented in Predict as a system, XRef data is automatically created when the program is documented in the data dictionary as a program in the library *SYSSYS*. The invocation method is CALL.

Where XRef Data for 3GL Members is Stored

With this version of Predict, you can store XRef data for 3GL members in the default library from the table below, or you can define your own library by documenting this library as a Predict object of type system. The Library parameter is also used by the preprocessor.

Language Default Library
BAL/Assembler *SYSBAL*
COBOL *SYSCOB*
FORTRAN *SYSFOR*
Language ADA *SYSADA*
PL/I *SYSPLI*
Static SQL *SYSSTA*
Language C *SYSCCC*

Contents of XRef Data for 3GL

The following information is stored for 3GL members:

  • the name of the program and the application it belongs to

  • the program type (only main program)

  • the date and time the program was last cataloged

  • the ID of the user who cataloged the program

  • the ID of the terminal from which the program was cataloged (in batch mode: the job name)

  • the names of 3GL programs invoked and the methods used to invoke them (only CALL, static SQL)

  • the names of external programs invoked

  • the names of files used in the program and the type of file usage (deleting, reading or updating)

  • the names of fields of files used in the program and the type of field usage (for counting, reading, searching or updating) (3GL precompiled by Adabas Native SQL).

Which Invocation Methods are Evaluated

See table below for the invocation methods evaluated when generating XRef data for third generation languages.

Language Invocation Method
BAL/Assembler CALL
COBOL CALL
FORTRAN CALL
Language ADA CALL
PL/I CALL
Static SQL Static SQL
Language C CALL

Types of LIST XREF Functions for 3GL

XRef data for third generation languages is retrieved with functions of the Predict XRef menu. There are essentially three groups of functions:

  • Functions that retrieve information on specific types of members in an application
    All functions from Invoked programs through Report programs with xref data in the XRef Menu are of this type (see screen below). See Retrieving Information for Individual Members .

  • Functions that retrieve information on the consistency of an application as a whole
    The functions are called via a submenu that is called with code A (Verify application). See Verify Application.

  • Functions that manage sets
    Sets allow efficient use of information retrieved from XRef data. Most of these functions can be executed only from a menu. See Using Sets.

 13:00:18              *****  P R E D I C T  *****                2007-05-31
                                -   Xref Menu   -
   
                            Code Object
                            ---- -------------------------------
                              I  Invoked programs
                              V  Views and fields
                              C  Copycode
                              X  Report programs with xref data
                              A  Verify application
                              O  Operate on sets
                           ---- -------------------------------
    Code....................:   (./?)
    Library ...............*:
    Library structure ID ...:
    System Id ..............:
   
    Command ===>
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Invp  GDAV  Quit  Sets  Rule  Copy  Xref  View  OSet  SPfk  Main  Exit  

The following functions are not available for static SQL:

I Invoked programs
C Copy Code
A Verify application integrity

Calling Functions of LIST XREF for 3GL

All LIST XREF Functions for third generation languages can be called from the Predict XRef menu or with a command. The XRef Menu itself can be called with a command ACTIVE XREF or with function code X in a Predict main menu.

A library must be specified, either a default library from the table below or a user-defined library.

Language Code Default Library
BAL/Assembler BA *SYSBAL*
COBOL CO *SYSCOB*
FORTRAN FO *SYSFOR*
ADA LA *SYSADA*
PL/I PL *SYSPLI*
Static SQL SQ *SYSSTA*

Example for PL/I:

LOGON SYSDIC
   MENU
   ACTIVE XREF *SYSPLI* PROGRAM USING VIEW

See LIST XREF Commands for more information on calling LIST XREF function with commands.

Using Sets

The LIST XREF for third generation languages often produces a list of objects that need further processing. To facilitate further processing Predict will save the output list of LIST XREF for third generation languages in a set, if the Save set switch of a Predict LIST XREF function is set to Y. Sets are saved in the same libraries as the active references for those languages. Up to ninety-nine sets of member types and names can be saved at any time in any library.

See Using Sets for more information.

Retrieving Information for Individual Members

All Predict LIST XREF function display information on members written in one specific third generation language. It is not possible to retrieve active reference information for more than one third generation language in one call.

Note:
See the respective section under LIST XREF for Natural for a description of retrieving information for individual 3GL members.

Invoked Programs

The functions of the Invoked Programs screen display XRef data about programs that are invoked from 3GL programs. The functions do not apply to static SQL. The screen is displayed by selecting code I in the XREF menu.

   13:23:13             *****  P R E D I C T  *****               2007-05-31
    Library:  LIBRARY          - Invoked Programs -                               
    
                  Code Function                                               
                  ---- -----------------------------------                    
                    D  Count references in program                            
                    C  Count references to program                            
                    U  Program using programs                                 
                    R  Program referenced in programs                         
                    E  Program using programs recursively                     
                    I  Program referenced in programs recursively             
                    X  Xref program using programs                            
                    Y  Xref program referenced in programs                    
                  --- -----------------------------------                     
    Code...........: ? (./?)                          Save set..: N (Y,N)          
    
    Using program..:                                                               
    Referenced prg.:                                                               
    External.......:                                  Rec. depth: 7 (1-7)          
     
    Command ===>                                                                   
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Invp  GDAV  Quit  Sets  Rule  Copy  Xref  View  OSet  SPfk  Main  Exit  

Function Codes

Code Function Answers the Question Remarks
D Count references in program How many programs does the program ABC refer to  
C Count references to program How many times is the program ABC referred to by programs  
U Program using programs Which programs does the program ABC refer to  
R Program referenced in programs Which programs refer to the program ABC  
E Program using programs recursively Which programs are referred to by the program ABC, or which programs are referred to by programs which are referred to by the program ABC. The output is structured to show the direct references to programs on the next level. See Truncating the output, below.
I Program referenced in programs recursively Which programs refer to the program ABC, or which programs refer to programs which refer to the program ABC.
X XRef program using programs Which programs are referred to by the program ABC, or which programs are referred to by programs which are referred to by the program ABC. The total number of programs on each level and the type and ID of each program are output in a report. This function gives a summary of the output of function E but ignores structural information.
Y XRef program referenced in programs Which programs refer to the program ABC, or which programs refer to programs which refer to the program ABC. The total number of programs on each level and the type and ID of each program are output in a report. This function gives a summary of the output of function I but ignores structural information.

Truncating the Output - Functions E and I

In some cases the listing of a LIST XREF function is truncated and marked as follows:

  • Recursion is marked with rec and the output is terminated.

  • The output can be truncated and marked with trunc at a level (up to seven) selected by the user.

  • The user can enter other parameters that limit the output (for example, to programs of a particular type or with IDs beginning with a particular letter). Output terminated in this way or terminated by a reference to a 3GL program is marked stop.

  • A program that has already been displayed at a higher level in the retrieval hierarchy is not repeated at a lower level. Instead the program is suppressed and marked suppr.

Limiting the Scope of the Functions

The following parameters limit the scope of the functions.

Parameters Description
Save set

Any user defined in Predict can save the types and names of programs listed by functions U, R, X or Y in a set. See Using Sets.

Note:
Sets only contain the resulting objects of the called function.

Using program The ID of the 3GL program for which the function is to be executed. Asterisk notation is possible.
Referenced programs The program or programs that are referred to by the 3GL program selected above.
External The point of entry into an external program (written in a different programming language) that is called. This parameter applies when a program is invoked without using its ID. Predict uses information from either Adabas Native SQL or the Predict preprocessor to identify the program to which an external entry belongs.
Rec. depth A number from 1 to 7: the recursion depth for the functions with codes E, I, X and Y.

Views and their Fields

The functions of the Views and Fields screen display XRef data about views and fields. The screen is displayed by selecting code V in the XRef menu for a 3GL.

    13:24:19             *****  P R E D I C T  *****              2007-05-31
     Library:  LIBRARY        -    Views and Fields   -
   
   
                       Code Function
                       ---- -----------------------------------
                         C  Count references to view
                         D  Count references to field of view
                         U  Program using views
                         R  View referenced in programs
                         F  Program using fields of views
                         G  Field of view referenced in programs
                       ---- -----------------------------------
    Code...........: ? (./?)
                                                      Save set....: N (Y,N)
    Program........:
    View...........:                                  View usage..:   (?)
    Field..........:                                  Field usage.:   (?)
   
   
    Command ===>
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Invp  GDAV  Quit  Sets  Rule  Copy  Xref  View  OSet  SPfk  Main  Exit  

Function Codes

Code Function Answers the Question
C Count references to view How many times is the view ABC referred to by programs
D Count references to field of view How many times is the field ABC referred to by programs
U Program using views Which views does the program ABC refer to
R View referenced in programs Which programs refer to the view ABC
F Program using fields of views Which views does the program ABC refer to, and which fields of these views does it refer to
G Field of view referenced in programs Which programs refer to the field ABC

Parameters Limiting the Scope of the Functions

Code Answers the Question
Save set If the user is defined in Predict, the set of program types and names produced by functions R, G and B is saved.
Program The ID of the 3GL program for which the function is to be executed. Asterisk notation is possible.
View The Adabas userview that is referred to by the 3GL program selected above. Asterisk notation is possible.
View usage How the view is used by the 3GL program. One of the following values can be specified:
D Delete
M Modified (either deleted or updated)
O Only read (neither deleted nor updated)
R Read, deleted or updated
U Update
Field The field or fields that are referred to by the 3GL program. Asterisk notation is possible.
Field usage How the field is used by the 3GL program. One of the following values can be specified:
C Used as a counter field
O Either used as a counter field or read
R Updated, used as a counter field or read
S Search
U Updated

Copy Code

The functions of the Copy Code screen display XRef data about copy code. The functions do not apply to static SQL. The screen is displayed by selecting C in the XRef menu.

For programs in third generation languages, XRef data is only stored for copy code if is used directly (not via any other copy code).

     13:04:13            *****  P R E D I C T  *****              2007-05-31
     Library:  LIBRARY              - Copycode -
   
   
   
                         Code Function
                         ---- -------------------------------
                           C  Count references to copycode
                           U  Program using copycodes
                           R  Copycode referenced in programs
                         ---- -------------------------------
   
    Code...........: ? (./?)
                                                      Save set.... N (Y,N)
    Program........:
    Copycode.......:
   
   
   
   
    Command ===>
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Invp  GDAV  Quit  Sets  Rule  Copy  Xref  View  OSet  SPfk  Main  Exit  
Code Function Answers the Question
C Count references to copy code How many times is the copy code ABC referred to by programs
U Program using copy codes Which copy code does the program ABC refer to
R Copy code referenced in programs Which programs refer to the copy code ABC
Parameters Limiting the Scope of the Functions
Save set If the user is defined in Predict, the set of program types and names produced by functions U or R is saved.
Program The ID of the 3GL program for which the function is to be executed. Asterisk notation is possible.
Copy code Copy code to which the programs refer. Asterisk notation is possible.

Report Programs with XRef Data

The function Report Program retrieves and displays a summary of active reference information about programs. The screen is displayed by selecting code X in the XRef menu for a 3GL.

     13:07:26            *****  P R E D I C T  *****              2007-05-31
     Library:  LIBRARY           - Report  Program -
   
   
             Program: ________  (?)
             User Id: ________  Terminal Id : ________
           from date: __________     to date: 2007-05-31
          short list: N (Y,N) save set: N (Y,N)
   
          Report                          Nr   Report                          Nr
          ------------------------------- --   ------------------------------- --
          Statistical data                 1   Predict description              2
          Using / Referenced programs      4   Views and fields                 5
          Copycodes                        7
   
          Format extended description      N   Suppress empty reports           Y
          ------------------------------- --   ------------------------------- --
   
    Command ===>
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Invp  GDAV  Quit  Sets  Rule  Copy  Xref  View  OSet  SPfk  Main  Exit  

Up to five types of information can be retrieved and displayed by the function:

Types of Information Reported by the Report Program Function
Statistical data The Program ID, the date and time when the program was precompiled, the ID of the user who precompiled it and the ID of the terminal from which it was precompiled.
Predict description The extended description and abstract that are stored in the Predict object for that program. If Format extended description is set to Y, Con-form, Software AG's text formatting facility, is used whenever a description is output. Any formatting instructions included in the description will be executed by Con-form.
Using / Referenced programs For each program that either invokes or is invoked by the specified program: the program type, the program ID and the method of invoking.
Views and fields Each view and each field of a view that is referred to by the specified program.
Copy codes All copy code referred to by the specified program.
Parameters Limiting the Scope of the Functions
Program ID   Enter either a unique program ID to limit the function to one program or use asterisk notation to specify a range.
User ID   The scope of a report to programs can be limited by specifying a user ID. Only those programs that have been precompiled from the terminal of the specified user will be processed. Asterisk notation is possible.
From date ... to date   The scope of a report to programs can be limited by specifying a range of dates. Only those programs that have been precompiled in the time specified will be processed.
Short list Y Displays a single line of information for each program selected.
N A more extensive report is created, containing up to seven categories of information. Enter digits in the Nr column to determine the sequence of the information displayed. Enter zeros to suppress categories that are not to appear.
Save set Y Any user defined in Predict can save the types and names of listed programs in a set. This feature is normally used together with the Short list option.See Using Sets.
Format extended description Y Any Con-form instructions contained in the extended description of any object will be executed. See Extended Description Skeleton in the section Defaults in the Predict administration documentation.
Suppress empty reports Y Suppress reports where no information is found in a particular category.

Verify Application

The following screen is displayed by selecting code A in the XRef menu for a 3GL (not available for static SQL):

    13:08:58             *****  P R E D I C T  *****              2007-05-31
     Library:  LIBRARY       - Verify Appl. Integrity -
   
   
   
   
   
                       Code Function
                       ---- -----------------------------------
                         R  Programs not referenced
                         E  Externals not impl. but referenced
                       ---- -----------------------------------
    Code...........: ? (./?)
   
   
    Save set.......: N (Y,N)
   
   
   
   
    Command ===>
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Invp  GDAV  Quit  Sets  Rule  Copy  Xref  View  OSet  SPfk  Main  Exit  
Code Function Answers the Question
R Programs not referenced Which 3GL programs are not referred to by any other programs written in the same programming language
E Externals not implemented but referenced Which external entries of programs written in this 3GL are not referred to by programs written in the same programming language

Operate on Sets

The names and object types of 3GL objects can be saved in sets for further processing. The information contained in the section Operate on Sets also applies to 3GL sets.

Maintaining a LIST XREF Profile

Three types of settings can be changed in a LIST XREF profile:

  • PF key assignments

  • the information to be included in reports created with the Report program function, and the sequence in which the information is to be displayed.

  • the functions to be executed by the Verify all function.

See Maintaining a LIST XREF Profile.