XREF

Use XREF to produce a sorted cross-reference listing.

Read syntax diagramSkip visual syntax diagram
XREF option syntax

   .-XREF-+---------------+-.   
   |      |   .-FULL--.   | |   
   |      '-(-+-SHORT-+-)-' |   
>>-+------------------------+----------------------------------><
   '-NOXREF-----------------'   

Default is: XREF(FULL)

Abbreviations are: X|NOX

You can choose XREF, XREF(FULL), or XREF(SHORT). If you specify XREF without any suboptions, XREF(FULL) will be in effect.

A section of the listing shows all the program-names, data-names, and procedure-names that are referenced in your program, and the line numbers where those names are defined. External program-names are identified.

A section is also included that cross-references COPY or BASIS statements in the program with the files from which associated copybooks were obtained.

Example: XREF output: COPY/BASIS cross-references

Names are listed in the order of the collating sequence that is indicated by the locale setting. This order is used whether the names are in single-byte characters or contain multibyte characters (such as DBCS).

If you use XREF and SOURCE, data-name and procedure-name cross-reference information is printed on the same line as the original source. Line-number references or other information appears on the right-hand side of the listing page. On the right of source lines that reference an intrinsic function, the letters IFN are printed with the line number of the locations where the function arguments are defined. Information included in the embedded references lets you know if an identifier is undefined (UND) or defined more than once (DUP), if items are implicitly defined (IMP) (such as special registers or figurative constants), or if a program-name is external (EXT).

If you use XREF and NOSOURCE, you get only the sorted cross-reference listing.

XREF(SHORT) prints only the explicitly referenced data items in the cross-reference listing. XREF(SHORT) applies to multibyte data-names and procedure-names as well as to single-byte names.

NOXREF suppresses this listing.

Usage notes

related concepts  
Debugging

related tasks  
Getting listings