Chapter 6: TSO Applications

Use a TSO session to run TSO commands, CLISTs and REXX execs on your PC. Within Mainframe Express, the TSO session is an interactive environment emulating TSO. You can build, run and debug CLISTs and REXX execs as if you were in a TSO environment.


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 TSO on a mainframe.


6.1 Overview

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

The demo applications used in this session are simple applications that you might have downloaded from a mainframe.

In this session, you get them working on your PC.

6.2 Preparation

Creating a project for an application that uses TSO is just the same as for one that uses JCL, which you did in the chapter Using Mainframe Express.

To save you creating the project used in this session, we supply the project tsodemo.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 tsodemo.mvp in any of the ways described in the chapter Start Here for the Tutorials.

    The full path is \mfuser\projects\gsdemo\tsodemo\tsodemo.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 .tso, rex and .cbl files in the Files View. If you click the Catalog tab you'll see the input file TSODEMO.DATA.TESTDATA in the Catalog View.

6.3 Sample Session

In this session you:

6.3.1 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 the COBOL source file.

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

6.3.2 Running the CLIST Application

To run the CLIST:

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

  2. Click the TSO tab if it is not already selected. The Clist or REXX exec to execute field has defaulted to the .tso file you selected.

  3. Click OK.

    The Application Output window appears. The TSO initialization phase is run and the CLIST starts. When the CLIST ends, the TSO termination phase is run.

    The first time you run this CLIST you will see messages indicating that the data set TSODEMO.DATA.OUT was not found and so was not deleted. You can ignore these. The CLIST contains a DELETE command to delete the output data set from the previous run so that the CLIST can be run more than once. The first time it is run that data set does not exist.

    If three asterisks appear in the Application Output window, press Enter to complete the run.

    The data from TSODEMO.DATA.TESTDATA has been copied to TSODEMO.DATA.OUT. You can check the run has worked by looking at the input and output files - double-click them both in the Catalog View. Close these windows when you've finished with them..

    You can leave the Application Output window visible, as the next section uses it as well.

6.3.3 Debugging the CLIST Application

You can debug the COBOL program used by the CLIST application like any other COBOL program:

  1. In the Files View, ensure mfdemo01.tso is still selected, then click Start Debugging on the Debug menu.

  2. Click the TSO tab if it is not already selected

  3. Click OK.

    The TSO session is started, as before, but when the COBOL program is entered a source view window appears and execution pauses.

  4. Click a few times.

    This demonstrates that you can single-step an application in TSO in the same way as in any other environment. All the same debugging features are available. We will not debug this application further, but will simply complete the run.

  5. Click to complete execution without further debugging.

    Again, if three asterisks appear in the Application Output window, press Enter to complete the run.

  6. Close the source view window.

    You can leave the Application Output window visible, as the next section uses it as well.

6.3.4 Running the REXX Application

To run the REXX exec:

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

  2. Click the TSO tab if it is not already selected. The Clist or REXX exec to execute field has defaulted to the .rex file you selected.

  3. Click OK.

    The Application Output window appears. The TSO initialization phase, the REXX exec, and then the TSO termination phase are run.

    The data from TSODEMO.DATA.TESTDATA has been copied to the screen. You can check the run has worked by comparing this output with the input file - double-click the file in the Catalog View. Close this window when you've finished with it.

    You can leave the Application Output window visible, as the next section uses it as well.

6.3.5 Running Individual TSO Commands

If you want to run TSO commands individually, you can start a TSO session without a CLIST or REXX exec. You simply set the Clist or REXX exec to execute field in the Start Debugging dialog box to spaces.

  1. Click Start Debugging on the Debug menu.

  2. Click the TSO tab if it is not already selected and delete anything in the Clist or REXX exec to execute field.

  3. Click OK.

    The Application Output window appears. The TSO initialization phase is run and the READY prompt appears.

  4. You can now enter one or more TSO commands. For example, you can execute the REXX exec from here, by typing mfdemo02 and pressing Enter.

    If three asterisks appear in the Application Output window, press Enter to complete the run.

  5. When you have finished, type logoff and press Enter.

    The TSO termination phase is run and the TSO session ends.

6.4 Before Continuing

Hide the Application Output window.

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.


Comments on the books? Click Send Us Comments.


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