Steps to upgrading your application

The following steps describe an example process of importing your existing source files into Eclipse:

Tip:
  • If your application consists of a large number of files, consider starting by creating a project solely for the source files you are working on.
  • You can add any non-COBOL files (such as data files, HTML pages) to your projects. This enables you to edit and build them inside the IDE. However, if there are a lot of them, Micro Focus recommends you only add the files that are frequently used in your project.
  1. Organise your application's source code outside of Eclipse.

    Micro Focus recommends that you create a logical folder structure where individual folders store files of the same type such as:

    • source files
    • shared copybooks
    • binaries
    • data files
    Note:
    • Consider creating folders to group any logical components that can form projects.
    • Organize the folders in such a way that it is easy to use relative paths in your projects.
    • Make a note of any dependencies in your source code.
    • If it is not possible to store the source code in individual folders, make a note of any files you need to link to from your projects.
    • Plan for how to organize your code in separate projects.
  2. Disable the automatic builds in Eclipse to avoid rebuilding the entire workspace when adding files or making any changes.
  3. Start creating projects:
    1. Click File > New and select the project type.
      Tip: Use the COBOL Copybook or PL/I Include project for projects that are only going to store copybooks or include files.
    2. In the new project wizard, uncheck Use default location and specify the location where you want to store the project, outside of the Eclipse workspace.

      If the location specified is an existing folder, it will be turned into a project that contains all files and folders contained within it. This is useful if you have already created folders that represent the projects you want to create.

  4. In the project's properties (click Project > Properties) specify relative paths for the following:
    • Source files
    • Copybooks - go to the Copybooks page in the properties
    • Build output - specify in Output path on the COBOL page in the properties
  5. Add files to projects using one of the following methods:
    • Copying or linking - if you link the files, then they remain in their original location and are not copied into the project folder. You can use relative paths in order to make the projects portable.
    • Drag-and-drop - use this to move one or more files to your project. You can choose whether to copy the files or create links for them.

      Avoid using this for a large number of files as this can make the IDE unresponsive.

    • Importing - click File > Import > General > File System. Navigate to a folder and specify the files to import in your project. You can either copy or link to the files.

      Use the PROJECT_LOC environment variable to help make your project easily portable.

      This is the preferred method when your application has a large number of files or when the files to add to a single project are spread across multiple folders under a shared parent.

  6. Use the Determine Directives command on native COBOL and PL/I projects, if necessary.

    Note that any required Compiler directives will be set on individual files and not at the project level which might be confusing. If the directives safely apply to all of the files in the project, you can disable automatic directives determination and set the directives manually at the project level.

  7. Add any non-COBOL files (such as data or HTML files) to your project so you can easily edit them in Eclipse. If there is a large number of these files, you can add only the ones that are frequently used to your project.

    If you do not want to store these files in the project folder, you can store and use them from a folder outside of the project folder.

    You can use filters to hide these files from the Explorer view and remove them from the project - right-click the project and click Properties > Resource > Resource Filters > Add Filter.