Sample - BankDemo in Azure

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 already successfully configured and deployed the ESDEMO sample as described in the previous topics in this section and you have successfully started and run the ACCT example in Azure.

This walkthrough will take you through the steps required to build and deploy the BankDemo application into an Azure 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 and log in to the Azure management portal.
    2. Connect to the database instance where you would like to host the region and BANKDEMO database.
    3. Create a database called BANKDEMO in your chosen Azure database server.
    4. Open SQL server Management Studio, or the SQL Server Object Explorer in VS 2013 or later.
    5. Select the BANKDEMO database as the default database.
    6. Open the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\samples\Mainframe\CICS\DotNet\BankDemo\SQL\BankDemoCreateAzure.SQL file.
    7. Execute the SQL.

      The required tables will be created.

  2. Build the application in Enterprise Developer for Visual Studio.
    1. Open Enterprise Developer for Visual Studio.
    2. Open the bankdemo.sln.
    3. Select the relevant project to build:
      1. If using HCOSS, make BankDemo the startup project.
        1. Open the project properties:
          GUID-C765D243-A431-4996-9D65-8784E4D97F74-low.png

          1. Select the COBOL properties (1).
          2. Click Build Events (2).
          3. Enter the DSN name configured in the HCOSS tool below, e.g. BANKDEMO (3).
        2. Open the HCO for SQL Server Tools.
          GUID-2A8C7CB5-4A53-460C-AE4A-00A1A0AB3DB1-low.png

        3. Select the Manage Connections activity from the list, click the Azure radio button and click New SQL Server Connection in the connection list dialog.
          GUID-135D210E-8B10-4E9B-8548-5257E539CAE0-low.png

        4. Configure the connection data.
          1. Enter BANKDEMO as Data Source Name.
          2. You can only use SQL Server Login. Enter the correct username and password to access the Azure database instance.
          3. Enter the TCP address of the Azure database instance. e.g. tcp:sfcgreio.database.windows.net.
          4. Check Use a database other than the default database.
          5. Select BANKDEMO from the database dropdown list.
            GUID-EB5E921E-E5DC-481A-AE00-E3E888978FE1-low.png

          6. Click Save.
      2. If not using HCOSS, make BankDemo2 the startup project.
    4. 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.

    5. Note: This step is optional and 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.
      1. 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.
      2. Click Execute All.

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

        GUID-9CC98897-D108-42EA-8495-16ED153DAA44-low.png

  3. Package and deploy the Enterprise Server for .NET system to Azure.
    1. Open the Enterprise Server for .NET Administration UI and configure a deployment project for BANKDEMO as per the instructions found at Creating A New Deployment Project.
    2. Make sure that the listener endpoints, etc are correct.
    3. Make sure that there is a connection string for the user BANKDEMO database as well. It is sufficient to just add BANKDEMO in simple editing mode, and the tool will generate the advanced connection strings for you. If you wish to edit or change the connection strings themselves, enable advanced editing mode.

    Save and publish the deployment to Azure (Publishing And Control of a Deployment.).

  4. Deploy the system transactions and 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.
      • Make sure that your deployment configuration contains database connection strings for the master and cross region database similar to those supplied in the ESDEMO deployment example.

        If you wish to change the database connection string default, make sure that the Advanced edit mode is activated in the Options menu of the Azure service configuration panel.

      • Run bankdemodbdeploy <AzureDatabaseName >, e.g. bankdemodbdeploy wai3yvmxx1.

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

  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 Azure database.
      2. Configure an XA resource definition for the bankdemo database as described in Configuring XA resources.
        1. An XA resource definition will be used to define how the region is to connect to the database.
        2. Ensure that the application plan field in the XA resource definition is set correctly (BANKDEMO in this case).

          There is no need to set the application plan in the region definition file.

      3. Select the region definition file from the cross region database. It was deployed in the previous step.
        • It is called region_bankdemo_db.config.
        • If using HCOSS , edit the region definition or PCT entry and set the XA resource name to the name of the XA resource you created above.
    2. Start the region, making sure that the start/stop server name points to xxx.cloudapp.net, where xxx is the service name to which you deployed the Azure project.
    3. Ensure the system picks up the XA resource definition correctly, and the DFHPLT transaction was loaded from the database, and not from disk.
      GUID-DA1D041B-4B8E-4B53-B04E-187D8BA6D74A-low.png

  6. Run Bankdemo.
    1. Connect a TN3270 terminal to the listener port in Azure which you configured to be associated with BANKDEMO.

      For example:

      mycics.cloudapp.net port 9123

      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.

      GUID-5A775285-FF1B-4C78-96B1-9CFCDF9F2977-low.png

    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.
    5. Look at the console view in the administration tool, and notice that the transactions are being loaded from the Azure database as opposed to disk.