The -xref Option

The -xref option provides cross-reference information for each program entity, displaying the line number on which it was declared and the line numbers of all references to it.

The -xref listing for a program is added to the map listing; when you specify the -xref option, you receive a data storage allocation map by default. The cross-reference information appears on the map in the ATTRIBUTES column for each entity, after the line of map attributes information.

References to each entity are listed in the following format:

 DEF line_number REF line_number[...]

A sample map listing with the -xref option follows.

Figure 1-1 Sample Output from the -xref Option

EXTERNAL ENTRY POINTS 
NAME         CLASS           SIZE  LOCATION  ATTRIBUTES 
SYSPRINT     CONSTANT                        FILE EXTERNAL 
                                             DEF 41 REF 41 48 49 
PRIMES       CONSTANT                        ENTRY(MAIN)EXTERNAL
PROCEDURE PRIMES ON LINE 10 
NAME         CLASS           SIZE  LOCATION  ATTRIBUTES 
STORE_CLASS  CONSTANT                        ENTRY 
                                             DEF 90 REF 45 
ARITH_STR    CONSTANT                        ENTRY 
                                             DEF 56 REF 43 
PROCEDURE ARITH_STR ON LINE 56
NAME         CLASS           SIZE  LOCATION  ATTRIBUTES 
DECIMAL      BUILTIN                   BUILTIN 
ESC          AUTOMATIC 6     FFFFFFD8  PICTURED 
FLT_BIN      AUTOMATIC 4     FFFFFFE4  FLOAT BIN(15) 
                                       DEF 63 REF 71 
FIX_DEC      AUTOMATIC 3     FFFFFFEC  FIXED DEC(4,2) 
                                       DEF 62 REF 70
CHR_STR      AUTOMATIC 4     FFFFFFEO  CHAR(4) 
                                       DEF 61 REF 69 
BIT_STR      AUTOMATIC 4B    FFFFFFD4  BIT(4) 
                                       DEF 60 REF 68 
PROCEDURE STORE_CLASS ON LINE 90 
NAME         CLASS     SIZE  LOCATION  ATTRIBUTES 
NUMBER       AUTOMATIC 16B   FFFFFFE8  UNION 
 FIXED_N     MEMBER    2     00000000  FIXED BIN(15,0) 
 FIXED_N_BIT MEMBER    16B   00000000  BIT(16) 
STAT_A_EX    STATIC    3     External  FIXED DEC(5,0)EXTERNAL 
Y            BASED     4     -V-       FLOAT BIN(23)