Skip to content

CMNSRCPP - Assembler Macro Discovery

The CMNSRCPP utility program discovers assembler macros in assembler source code. It can also discover copybooks in assembler source code and may be used to replace CMNWRITE for this function. CMNSRCPP executes after the assembly (unlike CMNWRITE which executes before the assembly). CMNSRCPP processes two kinds of sidefile:

  • ADATA - Information about both macros and copybooks included by the assembler are passed in the SYSADATA output to CMNSRCPP. CMNSRCPP then records the details as source-to-copy records in the current package.

  • Output produced by the assembler LIBRARY exit. We have written our own assembler LIBRARY exit, CMNHLALX, which will pass on information only about macros to CMNSRCPP. This mechanism allows CMNWRITE to be used as well as CMNSRCPP in case you rely on some other feature of CMNWRITE (that is, other than the copybook detection feature). So, in this case, CMNWRITE will detect and write source-to-copy records for copybooks and CMNSRCPP will add source-to-copy records for macros.

The output from CMNSRCPP (which appears after the assembler output) looks a lot like the copybook analysis produced by CMNWRITE. The SYSIN to this utility is similar too with the TYP= keyword assigning library types to syslib libraries. The only significant differences in SYSIN are:

  • CLR=YES or NO

    CLR=YES is the default. This parameter tells CMNSRCPP whether (YES) to delete all pre-existing source-to-copy records for the component in the current package before proceeding. That is, we are using CMNSCRPP to record both macros and copybooks.

    CLR=NO means that pre-existing source-to-copy records will not be deleted. CLR=NO should only be specified where CMNWRITE will have cleared the source-to-copy records before adding entries for copybooks. CMNSRCPP then adds entries for macros only.

    You can capture any different copybooks and macros used in the second, third, fourth, etc. assemble for a given staging of an assembler program by incrementing C#C to greater than 1 and then using a conditional statement like the following sample:

    )SEL &ADATA NE Y OR &C#C GT 1
    CLR=NO
    )ENDSEL &ADATA NE Y OR &C#C GT 1
    

    To increment the C#C variable, embed skeleton CMN$$I#C before CMN$$WPP.

  • XCL=library.name

    This parameter tells CMNSRCPP to ignore macros and copybooks drawn from this library. It allows us to ignore library macros and copybooks over which ZMF has no control. In our skeletons we currently have these libraries specified:

    XCL=SYS1.MACLIB
    XCL=SYS1.MODGEN
    XCL=TCPIP.SEZACMAC