Example - Building COBOL Programs

The following example shows how to use Jenkins projects to build COBOL source code.

You are going to use Visual COBOL and one of the MFUnit Airport samples to see how to use Jenkins to build a COBOL application. The sample is stored in the \COBOL\AirportMFUnitDemo subfolder in the location of the Visual COBOL samples (which is c:\users\Public\Documents\Micro Focus\Enterprise Developer\Samples\COBOL\AirportMFUnitDemo by default).

Example of Building COBOL Programs with a Visual Studio Project

Before you create a Jenkins project:

  1. Install Visual COBOL for Visual Studio on the machine where you want to build the sample.
  2. Copy AirportMFUnitDemo from the Samples folder to a temporary folder such as c:\temp.

To create a Jenkins project for building the sample:

  1. Create a new freestyle project.
  2. Configure the project to work with COBOL - see Setting up the Environment.
  3. In the project's configuration page, in the Build section, click Add build step > Execute Windows batch command.
  4. Enter the following in the Command field:
    call "VSCMDpath\VsDevCmd.bat"

    Where VSCMDpath is the location of the Visual Studio command prompt batch file. For example, for Visual Studio 2022 Professional this is C:\Program Files (x86)\Microsoft Visual Studio\2022\Professional\Common7\Tools. Executing this sets the environment for building COBOL projects created with Visual Studio.

  5. Enter the following on a new line in the same field:
    MSBuild "c:\temp\AirportMFunitDemo\AirportMFunitDemo.sln"
  6. Click Apply and then Save.
  7. Click Build to build the project.