Your browser is not supported

For the best experience, use Google Chrome or Mozilla Firefox.

eBook

Visual COBOL: A Developer's Guide to Modern COBOL

By: Paul Kelly, Micro Focus

Visual COBOL: A Developer's Guide to Modern COBOL

Welcome to the Visual COBOL book resources page. You can download the examples referenced in Visual COBOL – A Developer’s Guide to Modern COBOL below. The examples are organized by chapter. Each chapter contains a zip file that, when extracted, consists of one or more projects that you can open using either the Visual Studio or Eclipse editions of Visual COBOL. For Visual Studio users, we included a solution file that will load all the projects forming the example. For Eclipse users, you will need to import the projects into a workspace. Since many of the provided examples build upon each other from chapter to chapter, you should use a clean workspace each time – otherwise you will have difficulty importing projects with duplicate names into the same workspace. Chapter 10 contains two versions of the same example – one with full functionality and one as a basis for the worked example used in Chapter 10.

Micro Focus provides a free student edition of Visual COBOL for download and educational use. To learn more about Visual COBOL Personal Edition and to register for your free copy, please visit: Visual COBOL Personal Edition

Have a question? Contact us at visualcobol@microfocus.com

Index

Ch. 1 Why Visual Cobol?

Ch. 2 What You Will Learn from This Book

Ch. 3 Getting Started

Ch. 4 Hello World and Managed Platforms

Ch. 5 Writing a Class

Ch. 6 Inheritance, Exceptions, and Collections

Ch. 7 Interoperating with Procedural COBOL

Ch. 8 Cross-Platform Programming

Ch. 9 Rental Agency Persistence

Ch. 10 Rental Agency User Interface

Ch. 11 Visual COBOL on the Web

Ch. 12 Program Structure and Compilation

Ch. 13 Type Definition

Ch. 14 Data Types

Ch. 15 Statements

Ch. 16 Expressions and Operators

Visual COBOL: A Developer's Guide to Modern COBOL

Known issues in running the examples

If using Visual COBOL for Eclipse, and you see the error “COBCH1558S Could not start JVM” when importing projects, you can fix this problem by adding the 64-bit JRE to the project’s build path. The version of Visual COBOL used to create the projects specified a 32-bit JRE by default; the latest versions use a 64-bit JRE and if a 32-bit JRE cannot be found this is the error that results.

  1. Select a project and click File, Properties.
  2. Expand Micro Focus and click JVM Build Path, then select the Libraries tab.
  3. Click Add Library and select COBOL JVM 64-bit Runtime System.
  4. Click Next, Finish, OK.

Adding a launch configuration

  1. Select the project and click Run, Run Configurations.
  2. Select COBOL JVM Application in the left-hand pane and click the New icon.
  3. Enter the name of the Main class in the dialog box and click Apply.

Chapter 5

The supplied Launch configuration does not work with all versions of Visual COBOL for Eclipse. If running PersistentLeases produces a class not found error, create a new launch configuration for main class MicroFocus.COBOL.Examples.MainClass.

Chapter 8

The supplied Launch configuration does not work with all versions of Visual COBOL for Eclipse. If running PersistentLeases produces a class not found error, create a new launch configuration for main class COBOL.Book.DateClient.MainClass in project DateClient.

Chapter 9

The supplied Launch configuration does not work with all versions of Visual COBOL for Eclipse. If running PersistentLeases produces a class not found error, create a new launch configuration for main class MicroFocus.COBOL.Examples.PersistenceLeases.

Chapter 10

If the Java project (JavaLeases) in the COBOL JVM version of the application shows a build path error after import, click Project, Clean, Clean projects selected below, and clean just the JavaLeases project.

Chapter 11 Section Running the JVM Application

If the JavaWebLeases project shows a build path error after import, click Project, Clean, Clean projects selected below, and clean just the JavaWebLeases project.

The text also states that the URL for the application is http://localhost:8080/JavaWebLeases/index.html. The port is sometimes 8085 rather than 8080. If the application doesn’t display in the Web browser as described, double-click the entry for your server in the Eclipse servers window (it is probably labeled Tomcat v8.0 server at localhost) which will display the Overview configuration for your server. You can see the port number used for HTTP/1.1, and change it if necessary (you will need to restart the server for the change to take effect).

release-rel-2024-3-1-9400 | Thu Mar 14 23:51:15 PDT 2024
9400
release/rel-2024-3-1-9400
Thu Mar 14 23:51:15 PDT 2024
AWS