Previous Topic Next topic Print topic


Adding files to your Visual Studio project

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. The Visual Studio project is in the C:\MFETDUSER\Bankdemo\Projects folder. You will be adding the source files to the Visual Studio project.

The other folders that are not so obvious are:

Folder Name Use
System\catalog Stores the catalog.
System\catalog\data Stores the data files.
System\DATA Contains printer output.
System\loadlib Stores the executable files once the application is built.
System\Logs Contain various log files indicating the progress of your application execution.
System\sysloadlib The demonstration application contains around 65 COBOL programs (in executable form only). All the executable files for these programs are stored here. As part of this tutorial, you are only going to build eight of the COBOL programs.
System\RDEF Contains the resource definition files for the Bankdemo enterprise server.
System Contains some resource definition data for CICS – this has been exported from the Mainframe and converted into a suitable form for the Workstation.

Configuring directives scanning

By default, the IDE is configured to automatically scan any new source files you add to the project. It assesses the code, determines what Compiler directives are required, and then automatically sets those directives on the files. To check what directives will be set:

  1. In Visual Studio, click Tools > Options.
  2. Scroll down to and expand Micro Focus, expand Directives and click COBOL.

    This page enables you to configure what directives are set on the COBOL files that you add to your project. The directives scanning determines the dialect, what EXEC CICS and EXEC SQL statements are used in the COBOL source files and sets directives as detailed on this page.

  3. Ensure all options are selected and click OK.

Adding COBOL source files

To add the COBOL programs to your project:

  1. In Solution Explorer, right-click the BankDemo project and click Add > Existing Item.
  2. Browse to C:\MFETDUSER\Bankdemo\Sources\cbl.

    By default, the file type filter is set to Enterprise Files (*.cbl; *.cpy; *.cob).

  3. Select all .cbl files in this folder and click Add.

    This adds all COBOL programs from the cbl subfolder.

    Note: In most cases, you add the actual COBOL programs to your Visual Studio project. Optionally, you could have left the source files in the original location and could have created links to them. This might be useful if you have large source files. In such cases, you would have used the Add As Link command to add the files to your project:

    Previously, you ensured the IDE is configured to scan the COBOL files you add into the project and set directives for dialect, EXEC CICS and SQL. When the files are being imported in the project, the IDE scans them for CICS and SQL settings and set the appropriate directives on each one of the files.

  4. Look in the Output window to see the result of the directives scan and what directives have been set on the files.

    If there are any issues such as the IDE not being able to determine the dialect because of missing copybooks, these are reported here.

  5. If, at any stage, you need to perform a directives scan of the COBOL sources in the project to set Compiler directives on them, right-click the BankDemo project and click Determine Directives.

Adding the copybook files

The copybook files in the C:\MFETDUSER\Bankdemo\Sources\copybook folder are used by the COBOL programs in the project. Your project is preconfigured to look for the copybook files in that location so the compilation will not fail. To see where this is set, click Project > BankDemo Properties to open the project properties. Then, click the Dependency Paths tab, and ensure Type is set to COBOL Copybook Paths. The folder that is listed on that page is the folder that includes the copybook files.

The copybook files are not compiled when you build the application which is why it is not necessary to add them to the project. However, as an exercise, you can add one of the copybooks to the project in the same way you added the COBOL files.

Adding BMS source files to your project

You need to add the demonstration's BMS file to the project. To do this:

  1. In Solution Explorer, right-click the BankDemo project and click Add > Existing Item.
  2. Browse to C:\MFETDUSER\Bankdemo\Sources\bms folder.
  3. The file extension filter should be set to Enterprise Files but, as an exercise, you can set it to BMS Files (*.bms).

  4. Click the .bms file and click Add.

    This adds the BMS file to the project.

Adding JCL source files

To add the JCL file to your project:

  1. In Solution Explorer, right-click the BankDemo project and click Add > Existing Item.
  2. Browse to C:\MFETDUSER\Bankdemo\Sources\jcl folder.
  3. Set the file type filter to JCL/VSE Files (*.jcl; *.vse).
  4. Click the .jcl file and click Add.

    This adds the JCL file to the project.

Adding data files

The demonstration application includes a number of data files. 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 Solution Explorer, right-click the BankDemo project and click Add > Existing Item.
  2. Browse to C:\MFETDUSER\BankDemo\System\catalog\data.
  3. Set the file type filter to All Files (*.*).
  4. Select the EBC.BNKACC.DAT, EBC.BANKACC.PRO, EBC.BNKACC.STR and EBC.BNKACC.DFS and click Add.

Using the Project Details Window

You can use the Project Details Window to view a list of all files in your project or in the entire solution together, explore details such as the file type, location, COBOL dialect, number of errors or warnings and whether there are file directives that differ from and override the directives set on project level. This can help you identify problems quickly. To open the window:

  1. Right-click your solution (or the project) in Solution Explorer and click Project Details Window.

  2. You can click either one of the columns to sort the list or, in Solution Explorer, click the solution and then the project to see how the list in the Project Details Window changes.
  3. Right-click a COBOL program in the list and experiment with clicking Properties or Determine Directives.

Grouping the files of the same type in Solution Explorer

You can also sort the files in the project by file type by toggling the Virtual View in Solution Explorer as follows:

  • In Solution Explorer, click BankDemo, and click in the Solution Explorer toolbar.

    This rearranges and moves the project by adding virtual folders for the different file types - COBOL programs, BMS or JCL files:

    Note that there is no folder for the copybooks as they are not added directly to the project in the IDE.

  • Click to toggle the Virtual View on or off.

Viewing the copybook dependencies

Solution Explorer shows which copybooks are used by your source programs. To view the copybook dependencies of a COBOL program, simply expand the node for that program:

Summary

You created a Visual Studio project, added the COBOL files, the BMS and the JCL files of the demonstration program as links to the project and added the path to the folder that contains the copybooks to the project's properties.

Next, you are going to explore the settings available in the IDE and then you are going to edit some of the source files.

Previous Topic Next topic Print topic