Modernization Hub

Cross Reference

Enhanced Definition

A cross reference, in the context of IBM mainframe systems and z/OS, is a listing or mechanism that identifies where specific program elements (such as data items, paragraphs, sections, or subroutines) are defined and subsequently referenced within a source code module or across related system components. It serves as a vital "information pointer" to show interdependencies and usage patterns, primarily generated by language compilers.

Key Characteristics

    • Compiler-Generated: Most commonly produced by language compilers (e.g., COBOL, PL/I, Assembler) as an optional or standard part of the compilation process, typically found within the compiler listing.
    • Element Tracking: Provides detailed information, often including line numbers or statement numbers, for both the definition and all occurrences (references) of a particular program element.
    • Scope: Can track internal elements within a single program (e.g., COBOL DATA DIVISION items, PROCEDURE DIVISION paragraphs) or external elements like called subroutines, copybooks, or DCLGENs.
    • Diagnostic Aid: Essential for debugging, impact analysis, and understanding program flow by quickly locating all uses or modifications of a specific variable or routine.
    • Symbolic Representation: Typically lists symbolic names (e.g., variable names, paragraph labels, DSECT names) and their corresponding locations within the source code.
    • Output Format: Usually presented in a structured, tabular format within the compiler listing, often organized alphabetically or by type of element.

Use Cases

    • Program Debugging: Quickly identify all places a variable is used or modified when troubleshooting unexpected program behavior or data corruption.
    • Impact Analysis: Determine which parts of a program or system will be affected by a proposed change to a specific data item, paragraph, or external routine.
    • Code Modernization/Refactoring: Understand existing dependencies before restructuring code, extracting modules, or migrating components, ensuring all references are correctly updated.
    • Documentation and Understanding: Aid in comprehending complex legacy code by providing a map of how various program elements interact and are utilized.
    • System Auditing: Verify that specific data elements are being used as intended, or identify unused code segments (dead code) that can be removed.

Related Concepts

Cross references are intrinsically linked to compiler listings as they are typically an integral section of the output generated during the compilation phase of a program. They complement source code management (SCM) systems by providing granular usage information for program elements, which is crucial for version control and change management. Furthermore, they are fundamental for impact analysis and program maintenance, working in conjunction with tools that analyze JCL and load modules to provide a broader view of system dependencies and inter-program calls.

Best Practices:
  • Always Generate: Configure compilers to always produce cross-reference listings, especially for production code, as they are invaluable for ongoing maintenance, debugging, and understanding.
  • Utilize Modern Tools: Leverage mainframe IDEs or specialized code analysis tools that can parse compiler listings or perform dynamic cross-referencing across multiple modules and copybooks for enhanced analysis.
  • Maintain Up-to-Date Listings: Ensure that compiler listings (and thus their embedded cross-references) are current with the deployed code version to avoid misleading information during analysis.
  • Combine with System-Level Analysis: For comprehensive impact analysis, combine program-level cross-references with system-level tools that track JCL, copybook, and database dependencies to understand the full scope of changes.
  • Review for Dead Code: Regularly use cross-references to identify program elements that are defined but never referenced, potentially indicating dead or obsolete code that can be safely removed to improve maintainability and performance.

Related Vendors

IBM

646 products

Broadcom

235 products

Applied Software

7 products

Related Categories

CASE/Code Generation

19 products

Operating System

154 products

Encryption

41 products

Files and Datasets

168 products