Example.bat

This batch file will compile a COBOL source program, and execute the COBOL program. The content of this file is as follows:
 @echo off
setlocal
REM %1 == example program file name (without extension)
 REM Compile the example program given by %1
set COBCPY=..;%COBCPY%
cobol %1 list() xmlgen(ws) noobj;
REM To compile for .NET managed code comment out the above line and
uncomment the following line
REM cobol %1 list() xmlgen(ws) ilgen iltarget(x86)
ilref(MicroFocus.COBOL.XmlExtensions)
ilref(MicroFocus.COBOL.XmlExtensions.Interop);
 REM Run example program
REM COBPATH needs to include the location of cobxmlext.dll.
run %1
endlocal

This batch file uses parameters that are specified by the caller of the batch file. The parameter is the filename of the COBOL program (without the .cbl extension).

To build and run Example 1 Export file and import file using this batch file, enter the following on the command line:

example example01