This tutorial takes you step by step through the process of configuring an Enterprise Server to run JCL applications, and then deploying and running a JCL application. This is intended both as an introduction to using JCL with the reUZE Developer and reUZE Server environments and as an Installation Verification Procedure (IVP) to confirm that JCL support is correctly installed.
The reUZE Server execution environment is built on top of the Micro Focus Enterprise Server technology that provides the infrastructure not just for executing COBOL, CICS, IMS, DB2, VSAM and JCL, but also for deploying existing transactions as Web Services for easier re-use within new architectures like .NET, J2EE or SOA.
JCL applications written to run on a z/OS or VSE mainframe can be run with the reUZE Server environment. You maintain the applications in Visual Studio.
You can maintain your JCL files on the PC using any text editor.
This tutorial uses the demonstration application JCL supplied with your COBOL development system. The JCL application performs four functions:
In this tutorial you perform the steps typically required in managing, maintaining and running JCL applications. In summary, you:
These are the steps to create and configure an Enterprise Server to run JCL applications.
To enable JCL support in an Enterprise Server, you need to do the following tasks:
To open the Enterprise Server Administration page in the IDE:
If it is hidden, display it by choosing View > Server Explorer or View > Other Windows > Server Explorer).
To create an MSS-enabled Enterprise Server:
To enable the JES support within MSS:
The Edit page that appears contains a hierarchy of tabs.
Don't click Apply yet — there is more to do on this page.
You need to specify the directories and other details needed for the Enterprise Server to find deployed programs. To do this:
| Field | Value to enter: | Details |
|---|---|---|
| JES Program Path | c:\tutorials\jcl\bin\x86\Debug | Path for the directory containing executable files to be run by your JCL jobs. This is the path to the Debug folder of your project that contains the .dll files. For debugging, the .idy and .cbl files are used. |
| System Catalog | c:\tutorials\jcl\catalog\catalog.dat | Path and name of the system catalog. This is a file that holds the details of data files, their attributes and locations. |
| Default Allocated Dataset Location | c:\tutorials\jcl\catalog\datasets | The default path for the directory where new data sets are to be created, if you do not specify a directory. |
| System Procedure Library | SYS1.PROCLIB | Set of cataloged PDS data set names that will be searched to resolve JCL procedure names. |
It is useful to have the character-mode console daemon window showing when the JCLDEMO region is running. To enable the console window:
The Edit page that appears contains a hierarchy of tabs.
The Edit page that appears contains a hierarchy of tabs.
You can now start JCLDEMO:
If Start server is disabled, click Stop server instead, and when JCLDEMO has stopped, restart it.
You can run JCL with the following kinds of Service Execution Processes (SEPs):
You can define initiators and printers to start up automatically whenever the Enterprise Server is started, and you can also create ones that last only for the current session.
To define an initiator to start automatically:
| Field | Value | Comment |
|---|---|---|
| Name | INITAB | Not case sensitive — gets folded to upper case |
| Class | AB | Not case sensitive — gets folded to upper case |
| Description | Initiator for class A and B jobs |
These are the steps to create a Visual Studio project comprising all the parts of your application, such as the COBOL source and the JCL batch files. We build the demonstration application in Visual Studio, deploy and run it on an Enterprise Server configured to run JCL applications and debug it dynamically.
To create a native COBOL project to hold the JCL demonstration program:
This creates a jcl folder in your working folder that holds your solution and project.
Note: Your project folder needs to have the catalog folder created beforehand in order to submit the JCL successfully.
To import the files from the JCL demonstration program into your Visual Studio project:
To specify the project properties:
The IDE enables you to associate your project with the running JCLDEMO Enterprise Server. To associate your project with the JCL server that you created, JCLDEMO, you need to:
If it is hidden, display it from View > Server Explorer or View > Other Windows > Server Explorer.
To build the solution:
The application .dll and .idy files are created in the output Debug folder in your project directory.
You do not need to deploy the application to your Enterprise Server as you configured the Enterprise Server search path to be the Debug folder in your Visual Studio project directory. Enterprise Server automatically finds the application files that it needs to run.
To submit the JCL application to the running JCL configured Enterprise Server:
See the output messages in the Enterprise Server Console Daemon for the result of running the JCL job.
The Enterprise Server Monitor and Control (ESMAC) works in conjunction with Enterprise Server Administration and enables you to view and control Enterprise Servers, and the services, packages, and handlers that run on those servers. The spooler is another name for the job entry subsystem, JES. It maintains a number of spool queues, showing the status of jobs in the system.
The IDE enables direct access to the Spool and Catalog on the ESMAC pages.
To see the spool queues:
The page that appears shows one of the spooler queues. Select a queue to display using the radio buttons.
This displays the Output Queue. It contains the output from the job you have just run.
This shows details of the job.
The output from this step consists of a small number of simple records.
The catalog file holds the details of data sets needed for the JCL jobs that run in an Enterprise Server. To view the catalog:
The page that appears shows the catalog file, MFIJCL.OUTFILE.DATA, created by the example job.
The file contents are displayed as a page in the browser.
The IDE enables you to debug a job running under Enterprise Server. It’s not possible to debug the JCL file but you can debug the programs that are invoked by the job that is EXEC PGM=PROG.
Before proceeding, stop any Enterprise Server region that may be running.
Before you can debug within the IDE, you must enable the dynamic debugging feature within your Enterprise Server. This option is available on the General properties page within Enterprise Server Administration.
By default, Enterprise Server uses ephemeral ports for its communication listeners, to prevent clashes occurring with other network software on your machine when a listener starts. However, this can make debugging more complex, since Enterprise Server is likely to be assigned a different port each time it starts.
To force Enterprise Server to use a fixed port number for debugging purposes:
During the startup sequence, watch for a mention of dynamic debug enabled. If you missed it, check the Enterprise Server Console in the Server Diagnostics page of Enterprise Server Administration.
Now that you have a fixed port, you should reassociate the region with your project in Server Explorer in Visual Studio.
Debugging requires no changes to your program code. It requires that your project is associated with the JCLDEMO Enterprise Server and that the Enterprise Server is configured to enable dynamic debugging, which you performed in the previous steps.
The debugger enters a wait state.
If you now submit the JCL file, the debugger stops in your JCLCREATE program.
The debugger should stop again in the JCLREAD program.
Notice the messages that have appeared in the Enterprise Server console window.
The debugger offers you a number of choices when specifying what you want to debug. You may choose a Job Name, a Job Number, a Step Name or the top-level program on the Debug tab of the project properties.
These choices enable you to perform remote debugging, to support multiple users debugging on the same region.
Given that you’re running Enterprise Server locally and no one else is connecting to it, you do not need to specify any options and the debugger debugs any debuggable program that it finds.
You can view the list of debuggers waiting to attach to your region using ESMAC:
This opens the ESMAC page.
You can also remove these debuggers from the list.
You can submit JCL to a region working on the remote machine, to enable it to access Enterprise Server. For this purpose the remote machine must have Enterprise Server with JCLDEMO configured and working.
Make sure the firewall is not working on the remote machine to be able to access Enterprise Server.
For more information about using reUZE Developer, refer to the Help either in the product or on the Micro Focus Web site.
Copyright © 2009 Micro Focus (IP) Ltd. All rights reserved.