PreviousAccessing Mainframe Files Maintaining and Creating Data FilesNext"

Chapter 11: Running JCL on the Mainframe

Use the JCL support in Mainframe Express to run on the mainframe an application you have created on the PC.


You need to have read the chapter Start Here for the Tutorials and worked through the first session, Using Mainframe Express, and the sessions JCL Jobstreams, Uploading and Downloading Files and Accessing Mainframe Files, before you do this session.

In this session, we assume you are familiar with JCL on a mainframe.


11.1 Overview

Having created and built an application on the PC, you can run it on the mainframe under the control of Mainframe Express. You link to the mainframe using SourceConnect, which you saw in the chapter Accessing Mainframe Files.

In this session, you use the same demo application as you used in the chapter JCL Jobstreams.

11.2 Preparation

You need to have configured SourceConnect. You did this at the start (up to the section Configuring SourceConnect) of the chapter Accessing Mainframe Files.

This demo uses the project jcldemo.mvp that you used in the chapter JCL Jobstreams.

  1. If you have closed Mainframe Express, open it as before. If any project window or other windows are open, close them.

  2. Open the project jcldemo.mvp in any of the ways described in the chapter Start Here for the Tutorials.

    The full path is \mfuser\projects\gsdemo\jcldemo\jcldemo.mvp. If you use Open on the File menu, you need the Files of Type field on the Open dialog box set to Project files (*.mvp) to see this file.

11.3 Sample Session

In this session you:

11.3.1 Copying a JCL Procedure to the Mainframe

The job mfdemo01.jcl includes a JCL procedure mfdemout.prc. When you submit the job to the mainframe from your PC, the copy of the job file on the PC is used, but the procedure file must reside on the mainframe. So you need to create a procedure library on the mainframe and copy the procedure file to it, as follows:

  1. Click MFA Drag&Drop on the Tools menu.

  2. Enter the user ID and password and any other information for your installation in the dialog box, as described in the section Contacting the Mainframe of the chapter Uploading and Downloading Files.

  3. Click OK.

    When communication is established, the right-hand pane lists data sets on the mainframe. Because you gave your usual search criteria, you should see your own data sets.

  4. Click Partitioned dataset on the MFA Data Access Services Allocate menu.

    A dialog box appears for you to define the data set you want to create.

  5. Enter the following (leave the remaining fields unchanged):

    Dataset name my-datasets.PROCLIB
    Quantity 1
    Directory blocks 1
    Logical record length 80
    Block size 6160

  6. Click OK.

    There is a short delay and then the right-hand pane is updated to show the new data set.

  7. In the left-hand pane, double-click the drive letter of the drive containing your \mfuser folder.

    This expands the tree view to show all folders on that drive.

  8. Similarly, double-click \mfuser, then projects, then gsdemo, then jcldemo, then source.

    You can now see all the files and folders within the folder \mfuser\projects\gsdemo\jcldemo\source.

  9. Now click MFDEMOUT.PRC and drag and drop this file onto the data set my-datasets.PROCLIB that you have just created on the mainframe.

  10. You can double-click my-datasets.PROCLIB to confirm that the procedure file has been copied.

11.3.2 Copying a COBOL Program to the Mainframe

The JCL procedure mfdemout.prc executes a COBOL program mfdemout.cbl. When you submit the job to the mainframe, the load module for this program must reside on the mainframe. So you need to copy the program to a source library on the mainframe. We will copy it to the partitioned data set my-datasets.DEMO.COBOL that was created in section Creating a Data Set in the chapter Uploading and Downloading Files, but you could use any suitable data set.

  1. Click MFDEMOUT.CBL in the folder \mfuser\projects\gsdemo\jcldemo\source in the left-hand pane of the MFA Data Access Services dialog box and drag and drop this file onto the data set my-datasets.DEMO.COBOL in the right-hand pane.

  2. You can double-click my-datasets.DEMO.COBOL to confirm that the file has been copied.

11.3.3 Compiling a COBOL Program on the Mainframe

Before you can run the job mfdemo01.jcl on the mainframe you must compile the COBOL program mfdemout.cbl on the mainframe. You can do this by submitting a job from the PC.

First you need to create a load library on the mainframe to contain the load module produced by the compilation.

  1. Click Partitioned dataset on the MFA Data Access Services Allocate menu.

    A dialog box appears for you to define the data set you want to create.

  2. Enter the following (leave the remaining fields unchanged):

    Dataset name my-datasets.LOADLIB
    Quantity 1
    Directory blocks 1
    Logical record length 80
    Block size 6160

  3. Click OK.

    There is a short delay and then the right-hand pane is updated to show the new data set.

Next you need to add the compile and link-edit job to the project, as follows:

  1. Click Add Files on the Project menu.

  2. In the Add Files to Project dialog box, open the folder \mfuser\projects\gsdemo\jcldemo\source. Ensure the Files of type field is set to Source Files.

  3. Select mfdemcob.jcl, then click Add.

  4. Click Done.

    In the Output window you might see several messages when the file is parsed because it uses a JCL procedure that does not exist on the PC. You can ignore these messages.

  5. Double-click mfdemcob.jcl on the Files view.

  6. Edit the the last two lines to specify the names of the source and load module libraries used by your installation, as created earlier in this chapter.

  7. Save the file and close the editor window.

Now you can run the compilation job on the mainframe.

  1. In the Files view, right-click mfdemcob.jcl in the right-hand pane and click Submit to Mainframe.

    Normally, when you do this, you get a dialog box asking for your user ID and password for the mainframe. You might not get this because you entered this information when you used Mainframe Access.

  2. If you do get this dialog box, enter the user ID and password and click OK. Also ensure that Enable polling of the mainframe spool is checked so that the spool output of the job is returned to the PC.

    The job is then run on the mainframe.

  3. Click the Spool tab on the Project view to see the spool output produced by the Job Entry System on the mainframe.

    The Status field shows Executing while the job is running. This changes to On hardcopy queue when the job has completed.

    By default, the Spool view is updated every 10 seconds. To change this value, click the Catalog tab and the Spool subtab on the Project Settings dialog box and edit the Poll mainframe every xx seconds field.

11.3.4 Running the Application on the Mainframe

To run the mfdemo01.jcl jobstream on the mainframe:

  1. Right-click mfdemo01.jcl in the right-hand pane of the Files view, click Submit to Mainframe and proceed as described in the previous section.

  2. Click the Spool tab on the Project view to see the spool output produced by the Job Entry System on the mainframe.

11.4 Before Continuing

Close the project. If you want to take a break before going on to the next session, you can close Mainframe Express.

Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.


Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousAccessing Mainframe Files Maintaining and Creating Data FilesNext"