Previous Topic Next topic Print topic


Moving Existing Native COBOL Applications to Visual COBOL

Native COBOL applications developed and built using previous Micro Focus products can be developed and built with Visual COBOL.

Visual COBOL provides a number of ways to import existing native COBOL code into the IDE.

Generally, the process of moving existing native COBOL code into Visual COBOL includes creating a project and adding your sources to it:

  1. You create a native Visual Studio project to hold your source code or start with an existing native project. Then, add the existing COBOL files to the project.

    The following utilities are available to assist you with this:

    Net Express Project Import wizard
    Enables you to import existing Net Express projects into the IDE and convert them to Visual Studio projects. To invoke the wizard, click File > New > Import Net Express Project. Next, to import the Net Express project, select its .app file and follow the wizard instructions.
    Create COBOL Project wizard
    Creates a COBOL project for a standalone COBOL file opened in the IDE. To invoke the wizard, use the Create COBOL Project context menu command in the editor, or right-click the standalone file is shown as a miscellaneous file in Solution Explorer, and click Create COBOL Project.
    Create Project from Existing Files wizard
    Guides you step by step in choose the type of project to hold your existing code and lets you specify the files to import. During the import, the IDE scans the files to determine whether they are COBOL programs or copybooks, and sets directives for each imported file as appropriate.
    To invoke the wizard, click File > New > Project From Existing Code.
    Add Existing COBOL Items dialog
    Enables you to add your COBOL files and copybooks to an existing project. During the import, the IDE scans the files to determine whether they are COBOL programs or copybooks, and sets directives for each imported file as appropriate.
    To invoke the dialog, right-click the project in Solution explorer and select Add Existing COBOL Items.
    Add Existing Items command
    Enables you to add your source files to an existing native project but does not set any directives on them.
    Right-click the project in Solution Explorer and select Add > Existing Item.
  2. Resolve any compiler errors caused by your source code. The following window can help you track and resolve issues in the files:
    Project Details Window
    Shows a list of the files in the project or the entire solution. Lets you sort the files by various file details to help track any issues
    Right-click the project or the solution in Solution explorer and select Project Details.
  3. Subdivide your project into several projects if needed with the help of the following dialog:
    Create Project from Selection dialog
    Use this to create new projects in your solution and move some of the source files to them. This can be helpful if you need to move code to a dynamic library project.
    In Solution Explorer, select the files which you want to move in a new project, right-click the selection and choose Create Project.
  4. Configure the project and the file properties as needed.
  5. Build and debug the project.

The recommended way to work with Visual COBOL is to include all source files in a project because this enables full support for the IDE editing, compiling and debugging features. There is limited support in the IDE for standalone files. Visual COBOL provides a command for creating projects for these files in order to enable full editor, build and debug functionality.

To create a project from a standalone file:

  1. Start by opening the file in the IDE - click File > Open > File.

    Alternatively, double-click the file in Windows Explorer or start it from a command prompt.

  2. Right-click in the editor and click Create COBOL Project.

    This starts the Create COBOL project wizard.

  3. Specify a name and output type for your project, and whether to create a project that compiles to .NET COBOL.
  4. Click OK.
Previous Topic Next topic Print topic