Unit Testing the Batch Application

The first thing you need to do is check that the Bankdemo application is executing correctly.

To execute the JCL, you need to run the application in an instance of the Micro Focus Enterprise Server (sometimes abbreviated to Enterprise Server). This demonstration includes a pre-configured enterprise server instance called Bankdemo which you need to import in Enterprise Server and start before you execute the Bankdemo application.

Important: You need Enterprise Developer or Enterprise Developer for IBM zEnterprise to execute the application as running applications is not supported in Enterprise Developer Connect.

Importing the Bankdemo server

To import the definition of the Bankdemo logical server (LSER):

  1. In the IDE, open the Server Explorer window.

    If the window is not visible, click View > Server Explorer (or View > Other Windows > Server Explorer).

    Tip: Use the Auto Hide button (Auto Hide) in the Server Explorer toolbar to pin the window to the IDE window.
  2. Right-click Micro Focus Servers and click Administration.

    This opens the Enterprise Server Administration page in the IDE.

  3. Click Import in the left upper corner of Enterprise Server Administration.
  4. On the Import server information page and under Recent directories click the directory for the BANKDEMO server.

    IMPORTBANKDEMOSERVERIMG-low.png

    This adds the path to the Selected source directory containing server data to restore field.

  5. Click Next three times, and then click OK to import the BANKDEMO server.
  6. The system returns to the main Enterprise Server Administration page.

    You can see the Bankdemo server appears in the list of servers. You need to start it before you can execute the online Bankdemo application.

    GUID-042A356F-11CB-414D-A52D-086F4AAFA0B1-low.png

Associate the Bankdemo Enterprise Server with your project

Ensure your application is associated with the BankDemo server:

  1. In Server Explorer, right-click Micro Focus Servers, and click Refresh to show the BankDemo server.
  2. Right-click the Bankdemo server and click Associate with project.
  3. Ensure there is a check before the name of the BankDemo application.

    GUID-EC2DF037-1BAD-410D-B6DD-AC8925B92845-low.png

  4. Click the BankDemo project in Solution Explorer and see that the details of the associated server appear in the Properties window. The TN3270 port number will be populated once you start the server.

    GUID-BC9E71C1-6FED-4DD0-8674-E26E93F60277-low.png

Configure the IDE settings for Enterprise Server

Configure the IDE to start the associated BankDemo server automatically as follows:

  1. Click Tools > Options.
  2. Expand Micro Focus, and click Enterprise Server.
  3. Check the following options on this page to enable the IDE to start or stop the associated server, and to enable dynamic debugging, for when it is not enabled in the server:
    • Automatically start the associated server - this ensures the IDE will start the server if it is not running when you execute the application.
    • Stop running servers on project close - this enables the IDE to stop the server when you close the project.
    • Automatically enable dynamic debugging - this ensures the IDE will check whether the server has dynamic debugging enabled and, if it is not, will enable it when you start debugging.
  4. Click OK.

Starting the Bankdemo Enterprise Server and Showing the Server Log

These are the steps to start the server manually, and are included for completeness. You do not have to start the server manually, as you have configured the IDE to start the server automatically.

  1. In Server Explorer, right-click BANKDEMO under Micro Focus Servers, then click Start.
    Note: You might receive an Enterprise Server Sign On dialog prompting you to provide connection details for the BANKDEMO server. This is a standard security dialog. Click OK without specifying any sign on details. Also, you may skip enabling password recovery.

    You may receive a Windows Security Alert blocking the MF Communications process. Click Allow access.

  2. Right-click the BANKDEMO server in Server Explorer, and click Show Console Log.

    See the Output window for the messages from the server log that show that the server has started.

    GUID-4DD09A02-E18C-45F3-928F-F3DD583AAC1F-low.png

  3. Right-click Micro Focus Servers again, and then click Refresh to see that the server has started.

    After several seconds, the server status on the Enterprise Server Administration page also changes to Started. You are now ready to execute the JCL.

Executing JCL

The JCL provided in your demo causes the COBOL application to read a file, sort the data and produce a report. The .jcl file, ZBNKSTMT.jcl, is in the Bankdemo project. To submit this job:

  1. In Solution Explorer, select the JCL file in the project, and then drag it across to Server Explorer, and drop it onto the BankDemo server.

    Alternatively, you can right-click the file in Solution Explorer, and select Submit JCL

    Note: If you have not started the Bankdemo server yet, since you configured the IDE to start the server automatically, you receive a notification that the server will be started. Click OK to confirm this.
  2. Check the Output window to see that the job has been submitted and that the job has completed.

    The Output window also includes a link for the job output, which you can open by pressing and holding CTRL, and clicking the link with the mouse.

    GUID-84F2DA42-C841-4BBB-9BE2-57105FD29D34-low.png

You now need to check the results of submitting the job.

Viewing the Catalog and the Spool

You can open the catalog and the spool directly from within the IDE.

To view the catalog:

  1. In Server Explorer, right-click the BANKDEMO server and click Show Catalog.

    Alternatively, in Solution Explorer, right-click the BankDemo project, and click Enterprise Server > Show Catalog.

    This opens the catalog.

  2. Click List to view all file entries in the catalog.

    GUID-7AA57EFB-7575-4872-A984-0B8D081B56DF-low.png

  3. Click a file name (for example, EBC.BNKACC) to preview the contents of the file.

To view the spool:

  1. In Server Explorer, right-click the BANKDEMO server, and click Show Spool.

    Alternatively, in Solution Explorer, right-click the BankDemo project, and click Enterprise Server > Show Spool.

    GUID-F992E754-1014-4CED-8F95-1205B35F8626-low.png

    This shows the spool with the Complete button selected to see a list of all jobs in the completed queue. Your job is the last in the list.

  2. Check the check box next to your job, and click Display.

    This opens a page with a variety of information for the job progress, showing return condition code (COND) of 0000:

    GUID-EA0E974D-5450-4B42-88E4-63C9AFBBA947-low.png

    In the details, there are:

    • Two SYSOUT results (one for the Extract and one for the SORT). Click these to see the details:

      GUID-73007ED3-9471-4B77-9A4B-8DED87231D2F-low.png

      Again, if you cannot see your SYSOUT files, click Printed on the Spool page.

    • To return to the previous page, press the backspace key.
    • The PRINTOUT which is the final printed results created by your job. Click PRINTOUT to see the results:

      GUID-9ECF14B8-D301-4193-818D-9C501E3C130E-low.png

You can now start to look at how to run the online application.