Every serious Easytrieve developer learns to read the compiler listing before trusting a test run. The listing is the authoritative map between what you typed in the Library and Activity sections and what the product actually compiled. When a job fails with a statement number in SYSPRINT, the listing tells you which source line that number represents. When totals look wrong, the DMAP section confirms whether your packed field starts in column 94 or column 49. When the compile step ends with return code 8, the embedded diagnostics point at the exact token the syntax checker rejected. This tutorial walks beginners through each major section of the listing, the PARM and LIST controls that expand or shrink it, and a practical workflow for using listings alongside runtime tracing and dump analysis.
Broadcom describes the compile listing as documentation of your program at compile time. At minimum you receive a header on each page, a numbered statement listing, diagnostics inserted near offending lines, and a compile summary. Depending on PARM DEBUG options and site defaults, you may also receive a cross-reference table, a program map, a data map, macro expansion detail, and file statistics at activity boundaries. Treat the listing as a bundle of related reports rather than a single narrative—you flip to the section that answers your current question.
| Section | Purpose | When you need it |
|---|---|---|
| Statement listing | Numbered source with errors and warnings inline | Fixing syntax errors; mapping stmt numbers to source |
| DMAP (data map) | Field offsets, lengths, types, file attributes | Suspecting wrong column positions or record layouts |
| PMAP (program map) | Executable program structure from compiler | Understanding generated logic for complex PROC flows |
| XREF (cross-reference) | Where each symbol is defined and referenced | Finding typos, duplicate names, dead fields |
| Compile summary | Options, libraries, error counts, code size | Verifying which DEBUG flags were active at compile |
The PARM statement, when present, must be the first statement in the program. It overrides site option defaults for that compile. DEBUG subparameters request optional diagnostic sections; LIST subparameters control FILE statistics and compile summary printing; ABEXIT controls abnormal termination handling at execution time but is often set during development compiles together with DEBUG. Broadcom's best-practices topic suggests a development-oriented combination such as DEBUG(PMAP DMAP STATE XREF LONG) with LIST FILE—your installation may publish a different standard, so compare against your options table.
123456789PARM DEBUG(PMAP DMAP STATE XREF LONG) ABEXIT(SNAP) LIST FILE FILE MASTER FB(80 800) %MASTER JOB INPUT MASTER NAME PAYLIST IF EOF MASTER STOP END-IF PRINT REPORT1 *
DEBUG PMAP produces a listing of executable program structure. DEBUG DMAP produces the data map—often the first place beginners look when numeric output shows garbage characters. DEBUG XREF with LONG expands cross-reference detail. DEBUG STATE adds information used when analyzing execution state after abnormal termination. DEBUG FLOW (documented separately under runtime tracing) maintains a rolling statement table at execute time; it may appear on PARM alongside listing options during integrated test compiles.
Beyond PARM, listing control statements format the physical listing. LIST ON prints subsequent source; LIST OFF suppresses it. LIST MACROS versus LIST NOMACROS controls whether macro library text appears inline. NEWPAGE forces the next source line to the top of a new page. SKIP n leaves blank lines for readability. PUSH saves current LIST settings; POP restores them—useful when you want macros hidden in one region but visible in another. These statements do not affect program logic and do not appear in runtime output; they only change the compile listing layout.
123456LIST ON MACROS FILE EMPLOYEE FB(120 2400) %EMPLOYEE LIST OFF JOB INPUT EMPLOYEE PRINT REPORT1
Errors and warnings are interleaved with your source. A dollar sign identifies a critical error; a plus sign begins a warning. The diagnostic usually points at the token most likely responsible— for example an invalid FILE subparameter or an undefined field in an IF condition. Fix critical errors before attempting execution; warnings may compile but indicate risky constructs such as implicit conversions or deprecated parameters. When multiple errors appear, start at the first critical error because later messages are sometimes cascaded noise from the same root mistake.
The data map lists every file and field with storage attributes: position within the record, length, data type, decimal places, and whether the field is file-linked or working storage. When your program reads a zoned decimal amount but DEFINE declared packed decimal, the DMAP shows the mismatch immediately. When two developers disagree about whether DEPT starts in column 98 or 99, the DMAP settles the argument without re-counting columns by hand. Cross-check DMAP output against your FILE copybook or layout document; if they differ, fix source before blaming the data.
Your FILE statement describes logical organization and record format. DEFINE and FIELD statements within the file macro describe individual columns. The DMAP merges those definitions into a single offset table the runtime uses. Virtual fields and derived fields also appear with their computed lengths. If a field is missing from DMAP, the compiler did not recognize the definition—look for a typo in the macro name or a DEFINE outside the correct file scope.
The cross-reference section lists each symbol with line numbers where it is defined and where it is referenced. This is invaluable when refactoring large programs: you can see whether SALARY-TOTAL is referenced only in one REPORT procedure or scattered across three JOB activities. XREF LONG increases detail at the cost of listing volume. For maintenance programmers arriving mid-project, XREF is often faster than ISPF search because it reflects the compiled view including macro-expanded names.
The summary at the end counts errors and warnings, repeats compiler and execution options in effect, lists macro libraries searched, and reports generated code size. Always verify that the options shown match what you intended—especially DEBUG and ABEXIT flags before handing a load module to production scheduling. If you requested LIST FILE, file statistics for each activity may also print at activity boundaries when execution occurs in the same step as compile-and-go; batch shops that separate compile and execute still rely on the summary from the compile step alone.
Beginners sometimes confuse the compile listing with SYSPRINT runtime output. The listing is produced at compile time and describes static structure. SYSPRINT at execute time carries runtime messages, DISPLAY traces, file statistics (when enabled), and Error Analysis reports. Both documents may reference statement numbers, but only the listing shows DMAP and XREF. Store listings in the same change ticket as source updates so auditors can reproduce the compile environment months later.
Verbose DEBUG options add compile time and listing bulk. Production compile procs often use LIST OFF, reduced DEBUG, and ABEXIT NO per Broadcom guidance to limit overhead. Development compiles favor full maps. Never assume production listings look like your personal test listing—compare PARM lines explicitly when a production abend arrives and the operations team sends a minimal listing bundle.
The compiler listing is like the answer key your teacher prints when you hand in homework. It shows every line you wrote with numbers down the side, circles the spelling mistakes, and includes a chart that says where each piece of information sits on your worksheet. When something breaks during the test run, you use those same numbers to find the line that caused trouble. Without the listing you are guessing; with it you can point to the exact sentence.
1. The compile listing is produced when:
2. DMAP on the PARM DEBUG clause requests:
3. In the statement listing, a dollar sign ($) in a diagnostic usually marks:
4. LIST OFF as an early source statement:
5. The compile summary at the end of the listing typically includes:
It is the printed output of the compile step: numbered source statements, embedded warning and error messages, optional maps and cross-references, and a compile summary. You use it to fix syntax errors before execution and to correlate runtime statement numbers with source during debugging.
On z/OS batch, the listing is routed according to your job DD allocation—often a SYSPRINT or compiler-listing data set defined in the Easytrieve proc. Exact DD names depend on installation JCL. Always follow your site compile proc rather than assuming a universal DD name.
Common test combinations include DEBUG(PMAP DMAP STATE XREF) with ABEXIT settings appropriate for your environment. DMAP validates field layout, XREF shows where symbols are referenced, PMAP shows generated program structure, and STATE adds execution-state information useful when abends occur. Site defaults may already enable some options.
Yes. Broadcom documents LIST OFF to suppress statement text while PARM DEBUG subparameters still control optional sections such as DMAP, PMAP, and XREF. Many shops use LIST OFF MACROS in production-bound compiles to shorten listings while retaining maps during development.
When DEBUG FLOW or ABEXIT flow output is active, runtime diagnostics may reference statement numbers that match the numbered statement column in the compile listing. Keep the listing from the same compile that produced the load module you executed.