Assembling And Linking Executable Modules And Data Tables

The assembler component is not integrated into the Enterprise Developer IDE, so all programs and data tables must be assembled and linked from a command prompt. To do this in Enterprise Developer perform the following steps:

  1. Start an Enterprise Developer command prompt by clicking Start > All Programs > Micro Focus Enterprise Developer > Tools > Enterprise Developer Command Prompt.
  2. Set the current directory to your source directory and enter the following command:
    MFASM <filename.MLC> [options] [;]

The most commonly-used assembly and linking options are:

Option Description
OMF(390) Produces an executable assembler module (default).
OMF(MOD) Produces a non-executable data table for loading by a CICS program.
OMF(OBJ) Produces an object module (.OBJ) file but does not link it.
[NO]ANIM Creates debugger files with extensions .IDF/.IDY for debugging.

Default is ANIM but assembler debugging is not available in Enterprise Developer.

[NO]LIST Creates an assembly listing file (.PRN) and a linker listing file (.LST). Default is NOLIST.
BAL Creates an assembler source code file with extension .BAL that has all assembler macros expanded and copybooks included as one single source code file.

Default is not to produce a .BAL file.

AMODE(24|31) Marks the assembler executable as running in a 24 bit or 31 bit addressing mode. Default is AMODE(31).

All COBOL programs passing parameters to assembler subroutines must be compiled with the AMODE(24) or AMODE(31) compile option themselves or a SOC5 (addressing error) abend will occur at call time. Unless they are specifically coded to accept ASCII data, assembler subroutines will expect all alphanumeric data to be EBCDIC so the calling cobol module should be compiled with the CHARSET(EBCDIC) option to override the Enterprise Developer default of CHARSET(ASCII).

Assembler executable subroutines are produced by running MFASM.EXE from a command line as follows:

MFASM TEST.MLC

This command will produce the following files:

  • TEST.OBJ, an object module used by the assembler linker
  • TEST.IDF/IDX, debugging files used by the assembler debugger (not supported in the Enterprise Developer environment)
  • TEST.390, The executable assembler program.

In normal usage the following command line is used:

 MFASM TEST.MLC NOANIM

Here the NOANIM option is also used to suppress the generation of unnecessary debug files. The resulting TEST.390 executable should be moved to the same subdirectory as other cobol executables in the application. At CALL time the cobol run time will search for and load executables with the .390 extension as it would any other executable file with extensions such as .DLL, .GNT, .INT etc.

Assembler data tables are produced by using the OMF (MOD) directive to generate files with the .MOD extension as follows:

 MFASM TEST.MLC OMF(MOD)NOANIM NOLIST

The resulting TEST.MOD file should be moved into the same directory as other cobol executables where it is assumed that a CICS cobol program will load it into memory by use of the EXEC CICS LOAD command.

The OMF(OBJ) option can be used to only assemble a module and not automatically invoke the assembler linker.

Command line compatibility with the assembler component of Mainframe Express is maintained. Batch files used with Mainframe Express should work correctly under Enterprise Developer. In particular the MF370CHK (Micro Focus 370 Checker) module along with the MM370ASM (standalone assembler) and the MF370LK (standalone assembler linker) are present. So command lines used under Mainframe Express to assemble and link assembler modules will work:

 RUN MF370CHK TEST.MLC OMF(390) NOANIM NOLIST;

as will command lines that assemble and link modules in separate commands:

RUN MM370ASM TEST.MLC NOANIM; RUN MF370LNK TEST.OBJ NOANIM NOLIST OMF(390);

Specifying Directories For Input and Output Files

The assembler in Enterprise Developer is the same assembler in the Micro Focus Mainframe Express product so it is possible to specify input and output directories for assembler macros, copybooks and other files in environment variables, configuration files or both. We supply a sample configuration file, MF370CTL.CFG, as an example. This file is located by default in the %ProgramFiles%\Micro Focus\Enterprise Developer\bin directory.

A series of SYSxxx variables control where input and output files can reside. All can be set using environment variables and any environment variable setting overrides any setting in an MF370CTL.CFG file. The relevant variables are listed in the tables below.

The following environment variables take a single directory:

Variable Description
SYSIN Macro input .MLC files
SYSLIST Assemble and Link listing files .MAT .PRN .LST
SYSWORK Assemble, Link and Animator/370 work files .BAL .IDF/.IDX
SYSPUNCH Assemble output .PCH files for PUNCH statements
SYSMPC Assemble input precompiled macros .MPC
SYSLIN Link input .LIN files and Assemble output .OBJ files
SYSLMOD Link output load-member .390 files

The following environment variables take multiple directories

Variable Description
SYSLIB Assemble input macro and copy files .MAC .CPY
OBJ370 Link input .OBJ files (must contain SYSLIN)

The following environment variable takes a single parameter:

Variable Description
SYSPARM Macro input SYSPARM value. The default is MF370.

All output directories are single directories but input variables will take multiple directories, separated by semicolons, which allows a user to specify several directories to be searched for macro and copy files. For example:

SET SYSLIB=.;C:\SYSLIB;C:\USERLIB1;"C:\USERLIB2 MFASM TEST.MLC"

tells the assembler to search the listed directories, in order, for macro and copy files as they are encountered during assembly. By setting SYSLMOD output files such as .390 files can be directed to specific output directories.

Note: For long pathnames that include spaces, ensure you enclose them in double quotes.

The assembler looks for MF370CTL.CFG in the current working directory before searching for it in the default location.