This demonstration shows you how to compile, link and debug an Open PL/I BANK CICS application using the Eclipse IDE.
The demo instructions assume you already have a basic understanding of how to use Eclipse and some basic familiarity with Enterprise Server.
If you decide to use the remote debug instructions, please check with your system administrator for connection details (machine name, port, connection type, credentials) before starting.
You must have the following software installed:
- Micro Focus Enterprise Developer for Eclipse. Click here to access the product Help and the release notes of Enterprise Developer.
- A TN3270 terminal emulator to run the CICS application.
Note: A license for Micro Focus Host Access for the Cloud (HACloud) Session Server TN3270 emulator is included with Enterprise Developer.
Before running this demo remotely, be sure you have a Micro Focus RDO and MFDS agent already configured and running on the remote UNIX/Linux machine. Please see the Micro Focus product documentation for more information.
Ensure that Server Explorer contains a connection to the default Enterprise Server Common Web Administration (ESCWA) server. Note that existing workspaces may already have this connection.
-
In the Server Explorer view, right-click and select New > Enterprise Server Common Web Administration Connection.
The New Enterprise Server Common Web Administration Connection dialog box is displayed.
-
In the Name field, type Local.
-
In the Server address field, type localhost.
-
In the Server port field, leave as the default 10086.
-
If the server connection is TLS-enabled, select TLS Enabled, and then click Browse and select the appropriate certificate.
Note: If TLS Enabled is selected, but you do not specify a certificate, the default Java keystore is searched for a valid one.
- Click Finish. The new ESCWA connection is displayed at the top level, in the Server Explorer.
Note: If you have already imported the BANKDEMO enterprise server region for the IDE Getting Started tutorial, you scan skip these steps.
- Run the
tutorial\createdefinition.ps1Powershell script (Windows) ortutorial/createdefinition.shshell script (Linux) to create theBANKDEMO.xmlregion definition file. - On the Server Explorer tab, right-click Local and select Import Server.
- Click Browse, select the
tutorial/BANKDEMO.xmlfile, and then click Finish. The BANKDEMO server should appear in Server Explorer under Local.
You must start the HACloud session server before attempting to use the HACloud TN3270 terminal emulator. To do this you need to start the respective Windows service (Windows) or the startsessionserver.sh script (UNIX).
Windows
-
Ensure you have a 64-bit Java installed and added to the PATH environment variable.
-
Open the Windows Service Manager.
-
Go to Micro Focus HA Cloud and click Start the service.
-
Alternatively, you can start the session by opening a command prompt as administrator and executing the following command:
net start mfhacloud
UNIX
-
Ensure that the installed Java is added to the PATH environment variable.
-
Start the Enterprise Server region that runs the application you want to connect to.
-
Open a terminal and set up the COBOL environment in it.
-
Run the following to start the session server:
startsessionserver.sh
- After opening Enterprise Developer for Eclipse, either create a new workspace or open an existing one.
- If it's not already open, open the PL/I perspective in the Eclipse IDE by clicking Window > Perspective > Open Perspective > Other > PL/I.
- Start the project import process by selecting Import from the File menu or right clicking in the PL/I Explorer tab, and selecting Import > Import
- On the import pop-up window, expand General, select Existing Projects into Workspace, and click Next.
- In Select root directory, click Browse to navigate to the location of the
tutorial\projects\Eclipse\plidirectory, select it, and click Select Folder. - The BANKMAIN, FETCHABLES and INCLUDES projects should now be visible on the Projects list.
- Ensure Copy projects into workspace is not checked, and click Finish
- Once the import is complete, the BANKMAIN, FETCHABLES, and INCLUDES projects should display in the PL/I Explorer tab.
- Be sure to check the active build configuration is 'x64' in the project properties before continuing as this demo is designed to run only in 64-bit mode.
- Ensure the project has been built (either because Auto-build is enabled) or by clicking Build on the Project menu.
In this release, the Enterprise Server security features are enabled by default. Tutorials that use enterprise server regions, however, assume that Enterprise Server security is not configured. To perform this tutorial without modification, you must disable the default configured Enterprise Server security. See To Disable the Default Enterprise Server Security Configuration for more information.
Important: Micro Focus does not recommend disabling Enterprise Server security permanently. If you disable the default Enterprise Server security to facilitate running tutorials then this should be performed on a network isolated machine. Re-enable security as soon as possible after completing the tutorial. See To recreate the Default Enterprise Server Security Configuration in the product documentation for steps on how to re-enable security.
- In an Enterprise Developer command prompt, run the command
DisableESDefaultSecurity.cmd. You will see a series of messages as the script disables default security. - Restart MFDS and ESCWA to pick up the configuration changes. You will now be able to use ESCWA without having to log in.
- Restart any running enterprise server regions to have them pick up the configuration changes. Regions will no longer require credentials for starting/stopping and other actions.
Ensure that Server Explorer contains a connection to the default Enterprise Server Common Web Administration (ESCWA) server. Note that existing workspaces may already have this connection.
-
In the Server Explorer view, right-click and select New > Enterprise Server Common Web Administration Connection.
The New Enterprise Server Common Web Administration Connection dialog box is displayed.
-
In the Name field, type Local.
-
In the Server address field, type localhost.
-
In the Server port field, leave as the default 10086.
-
If the server connection is TLS-enabled, select TLS Enabled, and then click Browse and select the appropriate certificate.
Note: If TLS Enabled is selected, but you do not specify a certificate, the default Java keystore is searched for a valid one.
- Click Finish. The new ESCWA connection is displayed at the top level, in the Server Explorer.
- In the Server Explorer tab, right-click on BANKDEMO under Local, and click Open Administration Page. This opens the Enterprise Server Common Web Administration (ESCWA for short) page outside of Eclipse.
- Click the CICS drop-down list, and select Configuration.
- Change the System Initialization Table from CBLVSAM to PLIVSAM, and click Apply. This configures the server to use some PL/I CICS resources.
- In the Server Explorer tab, right-click the BANKDEMO server, and select Associate with Project, and click BANKMAIN.
- Repeat the process for the FETCHABLES project.
Making these associations before you start the server enables the executables built by the projects to be used.
- On the Server Explorer tab, right-click the BANKDEMO server, and click Start.
- Click OK in the Enterprise Server Sign On dialog (you can leave the fields blank). You can check the Output view to see the progress of starting the server. This also starts the Enterprise Server Console Daemon window which also provides information about the server start-up.
-
To prepare for debugging in Eclipse, create a debug configuration by selecting Debug Configurations from the Run menu.
-
On the Debug Configurations dialog, right-click PL/I Enterprise Server, and click New Configuration.
-
Change the Name from New_configuration to something meaningful like BANK.
-
Type BANKMAIN in PL/I project, enter Local in ESCWA, Default in Directory Server, and BANKDEMO in Region. Click Apply and then click Debug.
-
Open a TN3270 emulation program like Micro Focus Host Access for the Cloud, and connect to localhost (or 127.0.0.1) on port 9023.
-
If you receive a dialog asking whether to automatically switch to the debug perspective, select Remember my decision, and click Yes.
-
Eclipse should automatically open the
SBANK00P.PLIsource file with the SBANK00P PROC line highlighted as the current line of execution. -
If line numbers are not turned on in the source window, right-click in the left-hand column of the source pane, and click Show Line Numbers.
-
You can step through the SBANK00P program, set breakpoints, and evaluate variables. Once you're ready to run the program to completion, select Resume/<F8> as many times as necessary to run the program to completion.
-
In the TN3270 emulator window, type a User id of b0001, and anything for the password, and press Enter.
Eclipse restarts debugging so you can debug through the SBANK10P program.
-
Once you are ready to run the program to completion, select Resume/<F8> as many times as necessary to run the program to completion.
As this application is psuedo-conversational, debugging will start and end with the invocation and completion of each transaction in the application. Since this is a small demo, all of the CICS programs after the Banking main options screen are not built for debug and the sources are not provided.
-
Once you are ready to leave the application, press F3 to end the application in the TN3270 window.
-
You can now disconnect your TN3270 terminal to end the demo.
When you have finished running the CICS demo, you can stop the associated the enterprise server as follows:
- In Eclipse, right-click the BANKDEMO server in Server Explorer, and click Stop.
- Check the Output view for messages that the server has been stopped. A number of messages also appear in the Enterprise Server Console Daemon window before it closes down.
Note: You should re-enable Enterprise Server security if you have not already done so. See To recreate the Default Enterprise Server Security Configuration in the product documentation for steps on how to re-enable security.