Previous Topic Next topic Print topic


Enterprise Server Clustering - Demonstration

Explore how you can share JCL work among several regions via Enterprise Server's clustering capability.
In this demonstration, we explore how JCL jobs that access shared datasets (catalog and spool) can run successfully across a cluster while maintaining dataset integrity.
  1. Start Enterprise Developer.
  2. Point your web browser at the URL http://localhost:86. It will display the main Enterprise Server Administration home screen.
  3. Click Import in the left-hand panel. The Import server information screen is displayed.
  4. Type the location of the demonstration clustering repository: %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\Classic\CLUSTER\repos, click Next three times and then click OK. You return to the main Enterprise Server home screen and the list of regions now includes the newly-imported regions: ESCLMGR, ESCLCLI1 and ESCLCLI2.
  5. Click Edit on the row for the ESCLMGR server. In the Configuration Information box, verify (and update if necessary) the ES_CLUSTER_SYSTEM_DIR environment variable as appropriate. In a typical/default installation, it should be set to: %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\Classic\CLUSTER\system.
  6. Repeat the above step for the ESCLCLI1 and ESCLCLI2 servers.
  7. Open the cluster solution in Visual Studio - it can be found in %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\Classic\CLUSTER.
  8. Explore the solution contents. The significant components are:
    LCKSLEEP.JCL
    This acquires a lock on dataset SYSI.CLUSTER.MYFILE and calls LCKSLEEP.CBL to sleep for 25 seconds.
    NOWAIT.JCL
    This acquires a lock on dataset SYSI.CLUSTER.ANOTHER and calls LCKSLEEP.CBL to sleep for 5 seconds.
    WAIT4LCK.JCL
    This acquires a lock on dataset SYSI.CLUSTER.MYFILE, the same dataset as LCKSLEEP.JCL and calls WAIT4LCK.CBL to sleep for 25 seconds.
    LCKSLEEP.CBL
    This program opens a file, writes to it, sleeps and then closes it.
    WAIT4LCK.CBL
    This opens a file, writes to it and then closes it.
    getosinf.cbl
    This determines the operating system, so that LCKSLEEP.CBL can call the correct sleep API.
    mfchkfs.cbl
    This determines what went wrong with a file operation.
  9. In the Solution Explorer, right-click on the name of the solution - CLUSTER - and click Build solution. The solution builds with no errors.
  10. Select Start > All Programs > Micro Focus Enterprise Developer > Tools > Enterprise Developer Command Prompt (32-bit). The Enterprise Developer command prompt appears.
  11. Start the ESCLMGR region by entering the following command:
    casstart /rESCLMGR
    After the ESCLMGR region starts, start the two remaining regions by entering casstart /rESCLCLI1 and casstart /rESCLCLI2.
  12. Right-click on ESCLMGR in Server Explorer, select Associate with project and ensure that cluster is selected.
  13. Right-click on Micro Focus Servers in Server Explorer and select Refresh - this will update the list of servers with their true state.
  14. After the three regions have started, we need to submit the supplied JCL jobs. In the Solution Explorer, expand the jcl folder, right-click on LCKSLEEP.JCL and select Submit JCL. . Repeat this for WAIT4LCK.JCL and NOWAIT.JCL. The following sequence of events occurs:
    • Job LCKSLEEP starts executing and sleeps for 25 seconds.
    • Job NOWAIT starts executing, sleeps for 5 seconds and completes successfully.
    • Job WAIT4LCK starts, but waits for LCKSLEEP.JCL to release the dataset.
    • Job LCKSLEEP completes its execution successfully.
    • Job WAIT4LCK continues with its execution and completes successfully.

    Messages in the console logs of ESCLCLI1 and ESCLCLI2 confirm this behavior:

    Sample extract from ESCLCLI1 console log:
    130212 10410153   4944 ESCLCLI1 CASSI5012I Successfully negotiated with ES Cluster manager ESCLMGR 10:41:01
    130212 10410173   6840 ESCLCLI1 CASBJ0005I Batch initiator started for job classes "A" 10:41:01
    130212 10410174   4944 ESCLCLI1 CASSI9025I RNLDEFs received and installed from ES Cluster Manager ESCLMGR. 10:41:01
    130212 10410214   6708 ESCLCLI1 CASSI1600I SEP initialization completed successfully 10:41:02
    130212 10410235   6860 ESCLCLI1 CASSI1600I SEP initialization completed successfully 10:41:02
    130212 10410235   6708 ESCLCLI1 CASSI5021I PLTPI Phase 2 - No PLT Specified 10:41:02
    130212 10580934   6840 ESCLCLI1 JCLCM0188I JOB01001 LCKSLEEP JOB  STARTED 10:58:08
    130212 10580955   6840 ESCLCLI1 Sleeping time will be 0000000025 seconds 10:58:09
    130212 10583555   6840 ESCLCLI1 JCLCM0182I JOB01001 LCKSLEEP JOB  ENDED   - COND CODE 0000 10:58:34
    Sample extract from ESCLCLI2 console log:
    130212 10412143   7184 ESCLCLI2 CASSI5012I Successfully negotiated with ES Cluster manager ESCLMGR 10:41:21
    130212 10412163   7260 ESCLCLI2 CASBJ0005I Batch initiator started for job classes "B" 10:41:21
    130212 10412164   7184 ESCLCLI2 CASSI9025I RNLDEFs received and installed from ES Cluster Manager ESCLMGR. 
    130212 10412204   7172 ESCLCLI2 CASSI1600I SEP initialization completed successfully 10:41:21
    130212 10412205   7272 ESCLCLI2 CASSI1600I SEP initialization completed successfully 10:41:22
    130212 10412225   7172 ESCLCLI2 CASSI5021I PLTPI Phase 2 - No PLT Specified 10:41:22
    130212 10581625   7260 ESCLCLI2 JCLCM0188I JOB01002 NOWAIT   JOB  STARTED 10:58:15
    130212 10581646   7260 ESCLCLI2 Sleeping time will be 0000000005 seconds 10:58:16
    130212 10582246   7260 ESCLCLI2 JCLCM0182I JOB01002 NOWAIT   JOB  ENDED   - COND CODE 0000 10:58:21
    130212 10582326   7260 ESCLCLI2 JCLCM0188I JOB01003 WAIT4LCK JOB  STARTED 10:58:23
    130212 10582346   7260 ESCLCLI2 MVSXR0092I JOB01003 WAIT4LCK Waiting for exclusive use of dataset
                      "SYSI.CLUSTER.MYFILE". 10:58:23
    130212 10583546   7260 ESCLCLI2 MVSXR0093I JOB01003 WAIT4LCK Required datasets have been acquired. 
                      Execution resumed. 10:58:34
    130212 10583566   7260 ESCLCLI2 JCLCM0182I JOB01003 WAIT4LCK JOB  ENDED   - COND CODE 0000 10:58:35
  15. You can stop the servers by issuing the commands: casstop /rESCLMGR, casstop /rESCLCLI1 and casstop /rESCLCLI2 at an Enterprise Server command prompt.
This exercise has demonstrated how Enterprise Server clustering permits multiple JCL jobs to run in parallel when no datasets are shared. Any two JCL jobs with shared datasets will not run in parallel - they will run sequentially to ensure dataset integrity.
Previous Topic Next topic Print topic