PreviousTSO Applications Using WorkgroupingNext"

Chapter 7: JCL Jobstreams

The JCL support in Mainframe Express is a batch environment emulating JCL. Use it to include a JCL jobstream in a Mainframe Express project. You can build your JCL and compile your application, edit it, and debug it in an JCL environment on your PC.


You need to have read the chapter Start Here for the Tutorials and worked through the first session, Using Mainframe Express, before you do this session.

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


7.1 Overview

This session takes you through maintaining and running an application using JCL on your PC. It shows you how to create and build a project that includes a JCL file.

The demo application used in this session is a simple application that you might have downloaded from a mainframe. It simply copies data from an input file to the screen. In this session, you get it working on your PC.

The chapter Using Mainframe Express introduced you briefly to running a JCL jobstream. This session goes deeper into the use of the JCL support. You see how to add a procedure to a procedure library and look at the spool and log files.

7.2 Preparation

You have already seen how to create a project for an application that uses JCL in the chapter Using Mainframe Express. To save you creating the project used in this session, we supply the project jcldemo.mvp.

  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.

    You'll see the .jcl and .cbl files in the Files View. If you click the Catalog tab you'll see the input file JCLDEMO.MFDEMO.DATA in the Catalog View.

7.3 Sample Session

In this session you:

7.3.1 Adding a Procedure to a Procedure Library

First you need to add a cataloged procedure to the procedure library SYS1.PROCLIB. A procedure library is a partitioned data set (PDS) and the procedures are members.

  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. Check the Add into PDS check box to put a check mark there, and enter SYS1.PROCLIB in the adjacent field.

  4. Select mfdemout.prc, then click Add.

  5. Click Done.

  6. In the Catalog View you will see that an entry has been added for SYS1.PROCLIB.

  7. Double-click the entry for SYS1.PROCLIB.

    The Catalog View changes to show the members of SYS1.PROCLIB. There is just one, MFDEMOUT.

  8. Double-click the entry for SYS1.PROCLIB(MFDEMOUT).

    A source view window appears showing the source of the procedure mfdemout.prc.

  9. Close the source view window.

  10. Enter * in the field to the left of the Filter button, and click Filter.

    This displays the list of data sets in the catalog again.

  11. If you look at the Files View, you'll see a new entry Proclib in the tree view. This gives you another way to see the contents of SYS1.PROCLIB.

7.3.2 Building the Project

To build the project:

  1. Click Build on the Build menu.

    As you saw in the chapter Using Mainframe Express, the correct compiler is automatically called for each source file - in this case, for the COBOL and JCL files.

    The build finishes with "Build finished with no errors".

7.3.3 Viewing the Spool File

As on a mainframe, a job produces at least one spool file, and the one spool file you always get is a JCL listing showing data allocations and so on. The Project window contains a view called the Spool View, where you can view these. You now view the spool file produced by Mainframe Express, showing what happened to the build job.

  1. Click the Spool tab.

    The spool file from the build job is shown in the Spool View.

  2. Double-click the spool file.

    A source view window appears showing the contents of the spool file. Notice that the cataloged procedure, MFDEMOUT, has been included in the jobstream.

    The //PROC and //JOBLIB statements are used when this job is run on a mainframe in another session. They are ignored when the job is run on the PC.

  3. Close the source view window.

7.3.4 Running the Application

To run the jobstream:

  1. In the Files View, click mfdemo01.jcl in the right-hand pane, then click Run on the Debug menu.

  2. Click the JCL tab if it is not selected. The Job name has defaulted to the .jcl file you selected.

  3. Click OK.

    The Application Output window appears and the application runs. You can see its progress in the Application Output window. If you view the SYSOUT file on the Spool view you can see that five records have been written from SYSUT1 to the temporary file SYSUT2.

  4. Before continuing, hide the Application Output window.

7.3.5 Viewing the System Log

Most JCL jobs that are run on the PC write to a file called the system log, which is equivalent to the system console on the mainframe. Messages that would go to the system console on the mainframe, go to the system log on the PC. This file is initially created by the first job that writes to it.

To view the system log:

  1. Click the Spool tab.

  2. Click View System Log.

    A source view window appears showing the contents of the system log.

  3. Close the source view window.

The system log can also be seen in the Catalog View. It is called MFMVS.SYSLOG.

7.4 Before Continuing

Note: This session contains no section on debugging a JCL jobstream, because the chapter Using Mainframe Express covered that.

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.

PreviousTSO Applications Using WorkgroupingNext"