Map the CSECTs in a load module or program object

You can list the organization of CSECTs within the load module or program object, the overlay structure (if any), and the cross-references for each CSECT. To map CSECTs, invoke AMBLIST with the LISTLOAD control statement.

For sample output, see LISTLOAD OUTPUT=MODLIST output, Alphabetical cross-reference, and LISTLOAD OUTPUT=XREF output (comparison of load module and program object version 1).

In Figure 1, AMBLIST is used to produce formatted listings of several load modules or program objects.

Note: If you are using AMBLIST to format program objects, IBM® recommends that you specify REGION=2M or higher.
Figure 1. Example: Listing several load modules or program objects
   //LOADLIST   JOB         MSGLEVEL=(1,1)
   //LISTSTEP   EXEC        PGM=AMBLIST,REGION=64K
   //SYSPRINT   DD          SYSOUT=A
   //SYSLIB     DD          DSNAME=SYS1.LINKLIB,DISP=SHR
   //LOADLIB    DD          DSNAME=LOADMOD,DISP=SHR
   //SYSIN      DD          *
       LISTLOAD OUTPUT=MODLIST,DDN=LOADLIB,
           MEMBER=TESTMOD,
           TITLE=('LOAD MODULE LISTING OF TESTMOD',20)
       LISTLOAD OUTPUT=XREF,DDN=LOADLIB,
           MEMBER=(MOD1,MOD2,MOD3),
           TITLE=('XREF LISTINGS OF MOD1 MOD2 AND MOD3',20)
       LISTLOAD TITLE=('XREF&LD MOD LSTNG-ALL MOD IN LINKLIB',20)
   /*
SYSLIB DD Statement
Defines an input data set, SYS1.LINKLIB, that contains load modules or program objects to be formatted.
LOADLIB DD Statement
Defines a second input data set.
SYSIN DD Statement
Defines the data set (in the input stream) containing the AMBLIST control statements.
LISTLOAD Control Statement #1
Instructs AMBLIST to format the control and text records including the external symbol dictionary and relocation dictionary records of the load module or program object TESTMOD in the data set defined by the LOADLIB DD statement. It also specifies a title for each page of output, to be indented 20 characters from the left margin.
LISTLOAD Control Statement #2
Instructs AMBLIST to produce a module map and cross-reference listing of the load modules or program objects MOD1, MOD2, and MOD3 in the data set defined by the LOADLIB DD statement. It also specifies a title for each page of output, to be indented 20 characters from the left margin.
LISTLOAD Control Statement #3
Instructs AMBLIST to produce a formatted listing of the load module or program object and its map and cross-reference listing. Because no DDN= parameter is included, the input data set is assumed to be the one defined by the SYSLIB DD statement. Because no MEMBER parameter is specified, all load modules in the data set will be processed. This control statement also specifies a title for each page of output, to be indented 20 characters from the left margin.
Figure 2 shows how to use AMBLIST to verify three modules. Assume that an unsuccessful attempt has been made to link-edit an object module with two load modules or program objects to produce one large load module or program object.
Figure 2. Example: Listing several load modules or program objects
>
   //LSTLDOBJ      JOB     MSGLEVEL=(1,1)
   //              EXEC    PGM=AMBLIST,REGION=64K
   //SYSPRINT      DD      SYSOUT=A
   //OBJMOD        DD      DSN=MYMOD,DISP=SHR
   //LOADMOD1      DD      DSN=YOURMOD,DISP=SHR
   //LOADMOD2      DD      DSN=HISMOD,DISP=SHR
   //SYSIN         DD      *
       LISTOBJ         DDN=OBJMOD,
           TITLE=('OBJECT LISTING FOR MYMOD',20)
       LISTLOAD        DDN=LOADMOD1,OUTPUT=BOTH,
           TITLE=('LISTING FOR YOURMOD',25)
       LISTIDR         DDN=LOADMOD1,OUTPUT=ALL,
           TITLE=('IDRS FOR YOURMOD',25)
       LISTLOAD        DDN=LOADMOD2,OUTPUT=BOTH,
           TITLE=('LISTING FOR HSMOD',25)
       LISTIDR         DDN=LOADMOD2,OUTPUT=ALL,
           TITLE=('IDRS FOR HISMOD',25)
OBJMOD DD Statement
Defines an input load module or program object data set.
LOADMOD1 and LOADMOD2 DD Statements
Define input load module or program object data sets.
SYSIN DD Statement
Defines the data set containing AMBLIST control statements.
LISTOBJ Control Statement
Instructs AMBLIST to format the data set defined by the OBJMOD DD statement. It also specifies a title for each page of output, to be indented 20 characters from the left margin.
LISTLOAD Control Statement #1
Instructs AMBLIST to format all records associated with the data set defined by the LOADMOD1 DD statement. It also specifies a title for each page of output, to be indented 25 characters from the left margin.
LISTIDR Control Statement #1
Instructs AMBLIST to list all CSECT identification records associated with the data set defined by the LOADMOD1 DD statement. It also specifies a title for each page of output, to be indented 25 characters from the left margin.
LISTLOAD Control Statement #2
Instructs AMBLIST to format all records associated with the data set defined by the LOADMOD2 DD statement. It also specifies a title for each page of output, to be indented 25 characters from the left margin.
LISTIDR Control Statement #2
Instructs AMBLIST to list all CSECT identification records associated with the data set defined by the LOADMOD2 DD statement. It also specifies a title for each page of output to be indented 25 characters from the left margin.