Sample - CICS BankDemo

The BankDemo application is a more advanced application than the ACCT example. It has more programs and maps, and more interestingly, can be configured to use HCOSS to access the samples database.

Note: This sample assumes that you have followed and completed the installation verification process described here Installing and Verifying the Software and you have successfully started and run the ESDEMO acct example.

This walkthrough covers the steps required to build and deploy the BankDemo application into a database-hosted deployment using a local machine architecture. It will use HCOSS to access the applications database.

If you do not want to use HCOSS to access the database, ignore the HCOSS configuration steps.

The BankDemo sample is in %PUBLIC%\Documents\Micro Focus\Enterprise Developer\samples\Mainframe\CICS\DotNet\BankDemo.
  1. Create the BANKDEMO database.
    1. Open the SQL Server Management Studio.
    2. Connect to the database where you would like to host the region and BANKDEMO database.

      They do not have to be on the same machine, but this tutorial assumes that all databases reside on the local machine.

    3. Open the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\samples\Mainframe\CICS\DotNet\BankDemo\SQL\BankDemoCreateAll.SQL file.
    4. Execute the SQL. This will create the required tables and pre-load them with the BankDemo data.

  2. Build the application in Enterprise Developer for Visual Studio.
    1. Open Enterprise Developer for Visual Studio.
    2. Open bankdemo.sln.
    3. Select the relevant project to build:
      1. If using HCOSS, make BankDemo the startup project.
        1. Open the project properties

        2. Select the COBOL properties (1)
        3. Click build events button (2)
        4. Enter the DSN name configured in the HCOSS tool below, e.g. BANKDEMO (3).
      2. If not using HCOSS, make BankDemo2 the startup project.
    4. For HCOSS, configure the database connection.
      1. Open the HCO for SQL Server Tools.

      2. Select the Manage Connections activity from the list on the left and select New SQL Server Connection in the connection list dialog.

      3. Configure the connection data.
        1. Enter BANKDEMO into the Data Source Name.
        2. Either use Integrated Windows Authentication, or Use the SQL Server Login, depending on how you wish to authenticate in the database.
        3. Enter the name of the relevant SQL server instance ( e.g. (local) or machinename\databasename ....).
        4. Check Use a database other than the default database.
        5. Select BANKDEMO from the database dropdown list.

        6. Click Save.
    5. Build the project.

      The project should build with no errors or warnings. For the HCOSS version, the post-build event will perform the bind to the configured database



    6. (Optional)This step is presented to show how to manually perform the bind step. The bind is normally done by the post-build event during the project build for the HCOSS project.

      Select the Manage Packages and Plans activity from the Activities list in the left pane.

      1. Make sure that the bind scripts tab is selected.
      2. In the Bind Script File Actions, click Open and open %PUBLIC%\Documents\Micro Focus\Enterprise Developer\samples\Mainframe\CICS\DotNet\BankDemo\BankDemo.hcodsn.
      3. Select BANKDEMO from the SQL Server Connection dropdown.
      4. Click Execute All.

        This will bind the binaries generated when you built the project to the BANKDEMO database.


  3. Deploy the BANKDEMO application into the cross-region database.
    1. Open an Enterprise developer command prompt as Administrator.
    2. Navigate to the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\samples\Mainframe\CICS\DotNet\BankDemo directory.
    3. Deploy the bankdemo application into the cross-region database.
      • At the command prompt, execute bankdemodbdeploy with the parameter to the database to deploy to, e.g. bankdemodbdeploy localhost/sqlexpress or machinename/databasename. or (local) or (local)/sqlexpress. Please note the use of the forward slash (/) when specifying the database name if required.

        It is well worth looking at this batch file to understand how files are uploaded to the database. This knowledge is invaluable to deployment when developing your own deployment scripts.

  4. Configure an XA resource definition for the bankdemo database as described in Configuring XA resources
    1. An XA resource definition is used to tell the region how to connect to the database.
    2. Ensure that the application plan field in the XA resource definition is set correctly (BANKDEMO in this case).
    3. You do not need to set the application plan in the region definition, as the XA resource definition takes precedence.
  5. Create the BANKDEMO region.

    These steps are not detailed, as most of the process has been previously described in other tutorials.

    1. Open the Enterprise Server for .NET Administration UI.
      1. Create a new CICS Region called BANKDEMO, hosted in the (local) database.
      2. Select the region definition file from the cross-region database. It was deployed in the previous step.
        • It is called region_bankdemo_db.config
        • Edit the region definition or PCT entry and set the XA resource name to the name of the XA resource you created above.
    2. Create a listener endpoint for the BANKDEMO region on a suitable port.
    3. Start the region.
    4. Check to see that the system picks up the XA resource definition .

    5. Start the listener.
  6. Run Bankdemo.
    1. Connect a TN3270 terminal to the listener port you configured to be associated with BANKDEMO.

      You should be presented with a blank screen, with a flashing cursor.

    2. Type 'bank' and click Enter.

      You will be presented with the initial login screen.


    3. Enter an account, in the format B000xx, e.g. B0001 and anything in the password field.

      You will be presented with the first screen (BANK20) in the demonstration application.

    4. Tab to a field, enter a character and click Enter.

      Look at the console view in the administration tool, and notice that the transactions are being loaded from the database as opposed to disk.