Previous Topic Next topic Print topic


Importing the BankDemo Project and Adding the Source Files

You need to create the BankDemo project from a template in your workspace and then add the source files to this project to be able to build, develop and test the application.

The source files of the demonstration application are stored in subfolders named after the file type (for example, bms, cbl, copybook, jcl) in the C:\MFETDUSER\Bankdemo\Sources directory.

Creating the BankDemo Project from a Template

You start by creating the pre-configured project in the Eclipse workspace:

  1. In the Team Developer Tree view, right-click the displayed standard application for Enterprise Development Projects, and select New Project from Template.

  2. Click Retrieve next to Template Path.

  3. Browse to the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\Bankdemo\Workspace\Bankdemo folder, and click OK.
  4. Type Bankdemo in the project name field and click OK. This creates a copy of the Bankdemo project in your Eclipse workspace and adds the project to the application in the Team Developer Tree view. If the Bankdemo project entry is not displayed in the tree view, refresh the Enterprise Development Projects entry.
  5. Expand the Bankdemo project in the Team Developer Tree view.

The Bankdemo Project

Your project is pre-configured so that the build process creates the output files in a location that is used by the Enterprise Server logical server. To check which folder will include the built files:

  1. In the Team Developer Tree view, right-click the Bankdemo project, and click Properties.
  2. Expand Micro Focus, Build Configurations and then click COBOL.
  3. Note that the Output Path field points to the loadlib directory which will be created in the project directory at build time.
  4. You can cancel the project properties dialogs.

Adding the Demo Source Files

In most cases, to add files to an Eclipse project, you use the Import command. This creates local copies of file sources in the workspace. Optionally, you can leave the source files in the original location and create links to them. To do this:

  1. In Team Developer Tree view, right-click the Bankdemo project, and click New > Folder> Folder....
  2. Click Advanced and check Link to alternate location (Linked Folder).
  3. Browse to C:\MFETDUSER\BankDemo\Sources, and click OK.
  4. Click Finish.

    This adds the folders storing the source files to your project as linked resources:

    By default, Eclipse is set to build projects automatically (see Project > Build Automatically), so it immediately compiles the files you have just added.

    Check the Console and Problems views and see that some of the programs failed to compile. In Team Developer Tree view, you can select a program and check the error and warning count property in the Properties View to indicate that there are compilation problems.

    The errors are due to the correct copybook paths not being specified in the project properties.

Setting Compiler Directives

To perform a scan of the COBOL programs in your project to determine and then set the appropriate Compiler directives:

  1. Right-click Bankdemo and click Determine Directives.

    The IDE performs a scan of the files and shows a report of what directives for dialect and for CICS must be set on the programs in your project in order for them to compile cleanly.

  2. Click OK to set the directives.

    If you are prompted to delete some user files, choose No.

Setting the missing Compiler directives triggers a full rebuild of the project. There are still some errors in the COBOL sources due to the fact that the project cannot resolve the paths to the copybook files.

Specifying the Copybook Paths for the Project

To specify the copybook paths for the project:

  1. In Team Developer Tree view, right-click the Bankdemo project, and click Properties.
  2. Expand Micro Focus, and then click Build Path.
  3. Click the Dependency Paths tab and ensure Type is set to COBOL Copybook Paths.
  4. Check the Bankdemo/Sources/copybook entry in the list, and then click OK.

    Eclipse rebuilds the project and now all COBOL programs should compile cleanly.

Adding Data Files

The demonstration application includes a number of data files used. To see how you can edit data files, you only need to look at one of these files so you do not need to add a folder for it to the project. To add the data file to your project:

  1. In the Team Developer Tree view, right-click the Bankdemo project and click New > File > Other File.
  2. Click Advanced and check Link to file in the file system.
  3. Browse to the C:\MFETDUSER\BankDemo\System\catalog\data folder.
  4. Select EBC.BNKACC.DAT, and then click Open.
  5. Click Finish.

    This adds the file to the Bankdemo project and also automatically opens it in the Classic Micro Focus Data Files Tools utility. You can close the utility now as you will use it later.

  6. Repeat steps 1 to 5 for each of the files in the following list:
    • EBC.BANKACC.PRO
    • EBC.BNKACC.STR
    • EBC.BNKACC.DFS

Summary

You created an Eclipse project and added references in it to the COBOL files, the copybooks, the BMS and the JCL files of the demonstration program.

Next, you are going to edit some of these source files.

Previous Topic Next topic Print topic