This post has been republished via RSS; it originally appeared at: Azure Global articles.
First published on MSDN on Nov 14, 2018
Authored by Steve Read from AzureCAT
In a previous blog post I outlined the steps to set up Micro Focus Enterprise Server 4.0 and Enterprise Developer 4.0 in Azure and Azure Stack. As a follow up to that, I’d like to show you how to set up one of the sample applications that comes with Enterprise Developer, the CICS BankDemo application. If you are not familiar with the acronym CICS, it stands for (Customer Information Control System). It is the application / transaction platform for many of the online mainframe applications. The BankDemo application is great for learning how Micro Focus Enterprise Server and Developer operates and how to manage and deploy an actual application complete with green screen terminals. You will be using the Enterprise Developer VM we created in the earlier blog post. Keep in mind that Enterprise Developer has a complete instance of Enterprise Server on it for Dev/Test purposes. This is the instance of Enterprise Server you will be using.
Ready, let’s get started.
First, A word about the databases
Enterprise Server requires a database for the management of CICS Regions. The BankDemo application also uses a SQL Server Database – the BANKDEMO database. For this walk through, you will use SQL Express for both databases. You will need to download and install it on the Enterprise Developer machine. When installing, select the basic installation.
We will also need SQL Server Management Studio (SSMS) for managing the databases and running a T-SQL script. Download and install it on the Enterprise Developer machine.
Now that you have that squared away, here are the Steps:
Configure the Windows Environment
You may recall that on the last blog post you installed Enterprise Developer 4.0 on the VM. Now you need to configure the instance of Enterprise Server that comes with it. Before you do this, you need to make sure you have some additional Windows features installed.
- First, login via RDP to the Enterprise Server 4.0 VM you created in the last blog.
- Click the Search Icon next to the Start button and type “ Windows Features ”. This will take you to Server Manager Add Roles and Features Wizard. Select the following:
- Web Server (IIS) Role:
• Web Management Tools
• IIS 6 Management Compatibility (select all available features)
• IIS Management Console
• IIS Management Scripts and Tools
• IIS Management Service
- Web Server (IIS) Role:
- World Wide Web Services:
- Application Development Features:
- .NET Extensibility
- Common HTTP Features: Add all available features
- Health and Diagnostics: Add all available features
- Basic Authentication
- Windows Authentication
- Application Development Features:
- Windows Process Activation Service and all its children.
- Microsoft .NET framework 3.5.1:
- Windows Communication Foundation HTTP Activation
- Windows Communication Foundation Non-HTTP Activation
- Microsoft .NET framework 4.6:
- Named Pipe Activation
- TCP Activation
- TCP port sharing
- Once all the options have been selected, click next to install.
- After installing the above Windows features, go to Control Panel > System and Security > Administrative Tools > and select Services . Scroll down and make sure the NetTcpPortSharing, Net.Pipe Listener Adapter and Net.tcp Listener Adapter services are running and set to Automatic .
- Next, you need to configure IIS and WAS Support. From the menu locate Micro Focus Enterprise Developer Command Prompt (64 bit) and run as Administrator .
- Type wassetup -i and press Enter .
- After the script runs, you can close the window.
Configure the local system Account for SQL Server
There are some Enterprise Server processes that need to be able to login to SQL Server and create databases and other objects. Since these processes use the local system account, you need to give sysadmin authority to that account.
- Launch the SSMS and click Connect to connect to the local SQLEXPRESS Server using Windows Authentication. It should be available in the Server Name dropdown.
- Go to the Security folder on the left-hand side and select Logins .
- Select NT AUTHORITY\SYSTEM and select Properties .
- Select Server Roles and check sysadmin .
Create the Bank Demo Database and all its objects
- Open Windows Explorer and Navigate to C:\Users\Public\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\DotNet\BankDemo\SQL and copy the contents of BankDemoCreateAll.SQL file into your clipboard.
- Now, back to SSMS , right click on the Server and select “ New Query ”.
- Paste the contents of the clipboard into the New Query .
- Execute the SQL by clicking Execute from the Command tab above the query.
- The query should run with no errors and when it is complete we will have the sample database for the BankDemo application.
Verify the Database Tables and Objects have been created.
- Right click on the BANKDEMO Database and select Refresh .
- Expand the Database and select Tables . You should see something like the following.
Now, let’s build the Application in Enterprise Developer
- Open up Visual Studio and log in. You might need to create an Account if you do not already have one.
- Under the File menu option, select Open Project/Solution and navigate to C:\Users\Public\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\DotNet\BankDemo and select the sln file.
- Take some time to examine the objects. You will see COBOL programs in Solution Explorer with the CBL extension. You will also see CopyBooks (CPY) and JCL. You can go back later to examine what the code is doing. For now, let’s build the project.
- Right click on the BankDemo2 Project and select Set as Startup Project . Note : The BankDemo Project leverages HCOSS (Host Compatibility Option for SQL Server) which you are not using for this walk through.
- Now in the Solution Explorer , right click and the BankDemo2 Projectselect Build . The Project should build without any errors. Be sure to examine the Output window. It should look like the image below. Note : Building at the solution level results in errors as HCOSS has not been configured.
Deploy the BANKDEMO application into the Region database
- Open an Enterprise developer command prompt (64bit) as Administrator.
- Navigate to the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\samples\Mainframe\CICS\DotNet\BankDemo.
- At the command prompt, execute bankdemodbdeploy with the parameter to the database to deploy to, e.g. bankdemodbdeploy (local)/sqlexpress . Be sure to use a forward slash, not a backward one. This script will run for a while.
Create the BANKDEMO Region in Enterprise Administrator for .NET
- Open the Enterprise Server for .NET Administration UI.
- From the Windows Start menu, choose Micro Focus Enterprise Developer > Configuration > Enterprise Server for .NET Admin to start the MMC snap-in. (For a Windows Server, Micro Focus Enterprise Developer > Enterprise Server for .NET Admin.).
- Expand the Regions container in the left pane and then right click on CICS .
- Select Define Region to create a new CICS Region called BANKDEMO , hosted in the (local) database.
- Supply the database server instance and click Next and enter the region name BANKDEMO .
- Next, you need to select the region definition file for the cross-region database. It is called region_bankdemo_db.config and it is in the C:\Users\Public\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\DotNet\BankDemo directory .
- Next click Finish .
Create XA Resource Definitions
- In the left pane of Enterprise Server for .NET Administration UI, expand System and then XA Resource Definitions . This will define how the Region interoperates with Enterprise Server and application databases.
- Right click on XA Resource Definitions and select Add Server Instance .
- Select the Database Service Instance from the drop down. It will be the local machine SQLEXPRESS.
- Now select the instance from under the XA Resource Definitions (machinename\sqlexpress) container and click Add .
- Select Database XA Resource Definition and enter BANKDEMO for the Name and Region .
- Click the ellipses (…) to bring up the Connection String wizard and enter (local)\SQLEXPRESS for the Server Name, BANKDEMO for the Database name and make sure to select Windows Authentication .
- Finally test the connection.
Start the BANKDEMO Region
- VERY IMPORTANT - Navigate back to the BANDEMO CICS Region under the Regions Container and select Edit Region Startup File from the Actions pane on the right. You need to tell the Region to use the XA Resource Definition you just created. Scroll down to the SQL properties and enter bankdemo for the XA resource name or use the ellipse to select it.
- Click the Save icon to save the edit.
- Now, right click on the BANKDEMO CICS Region in the Console pane and select Start/Stop Region .
- This will bring up the Start / Stop dialog in the middle pane. At the bottom select Start .
- It might take a few seconds for the Region to start. The Region should start with no errors.
Create a Listener
You need to create a listener for the TN3270 sessions that will access the BANKDEMO application.
- In the left hand pane, expand Configuration Editors and select Listener .
- Click the Open File icon and select the seelistener.exe.config file. This is the file we will be editing and is loaded every time Enterprise Server starts.
- You should see two Regions previously defined (ESDEMO and JCLDEMO). We need to create a new one for BANKDEMO.
- Right click on Regions and Select Add Region .
- Select the BANKDEMO Region .
- Next we need to Add a Channel. Right click on the BANKDEMO Region and select Add Channel to select a TN3270 Channel .
- Enter TN3270 for the Name and 9024 for the Port (the ESDEMO application is already using 9230 so you need to use a different port).
- Now click the Save icon to save the file.
- Next, click the Start icon to start the Listener.
Configure Rumba to access the BANKDEMO application
The final thing you need to do is configure a 3270 session via Rumba (a 3270 emulator) to access the BANKDEMO application via the Listener we just created.
- From the Start Menu launch the Rumba Desktop.
- Under Connections menu item, select TN3270
- Click Insert and enter 127.0.0.1 for the IP address and 9024 for the User Defined port.
- Now click Connect at the bottom of the dialog.
- You should be presented with a black CICS screen.
- Now enter "bank" and you should see the initial 3270 screen for the BANKDEMO application.
- Now enter B0001 for the User Id and anything for the Password and you will be taken to the first screen BANK20.
Congratulations, you are now running a CICS application in Azure using Micro Focus Enterprise Server. Next, we will look at running the Enterprise Server Hello World Docker Demonstration.
Send me an email at email@example.com if you have any questions.
"Hands-on solutions, with our heads in the Cloud!"