Chapter 10: Accessing Mainframe Files

From your PC, use the Micro Focus software Mainframe Access from within Mainframe Express to view and access data sets held on the mainframe. You can access mainframe VSAM, QSAM, BPAM data sets, as well as Librarian, Panvalet and in-house source code control system data sets.


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

The use of Mainframe Access requires additional Micro Focus software (Mainframe Access Server) running on the mainframe. Before running this session, check that your site intends to use this software rather than some other method of accessing mainframe files. Full information is supplied with the Mainframe Access.


10.1 Overview

Mainframe Access provides the following facilities:

In order to use SourceConnect or DataConnect, you need to specify the communications link to the mainframe. Then, for SourceConnect, you assign a PC-type drive letter. You can associate catalog search criteria with the drive letter so that a number of partitioned data sets, or other source control systems on the mainframe, appear as folders (directories) for that drive letter. You can then, from within the IDE, access a data set on the mainframe as if it were a folder on your PC, and its members were files in that folder. For DataConnect, you simply specify the data set name on the mainframe when you add the data set to the catalog, or set a value in Project Settings that directs Mainframe Express to look on the mainframe for files that are not in the catalog on your PC.

In this session, you specify the information that allows Mainframe Express on your PC to communicate with the Mainframe Access Server on your mainframe. Then you assign a drive letter with search criteria that include the PDS you created in the chapter Uploading and Downloading Files. You then create and build a project similar to the one in the chapter Using Mainframe Express, except that you use two files that you transferred to the mainframe in the chapter Uploading and Downloading Files:

10.2 Preparation

You may be asked for the following information when you run the sample session. If in doubt, ask your system administrator.

Also check with your system administrator that the communications module that Mainframe Express uses to communicate with the mainframe is installed and configured for access to your mainframe.

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

10.3 Sample Session

In this session you:

10.3.1 Specifying the Communications Link

Before you can use either SourceConnect or DataConnect, you must specify the link to the mainframe.

  1. Click Server Access Configuration on the Options menu.

    The Server Access Configuration dialog box appears.

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

  3. Click Add.

    The Node Configuration Wizard appears.

  4. Specify the name to use to refer to this connection to the mainframe, then click Next.

  5. Click the option for the communications protocol you want to use (TCP/IP or APPC), then click Next.

  6. Specify the connection details, depending on the protocol you selected in the previous step, then click Next.

    If you selected TCP/IP:

    If you selected APPC, specify one of the following sets of information:

  7. Click Next.

    The configuration settings you specified are summarized.

  8. If the displayed settings are correct, click Finish to complete the configuration. If you want to make changes, click Back until you reach the settings you need to change, then proceed as before.

10.3.2 Configuring SourceConnect

For SourceConnect there are two further configuration actions:

10.3.2.1 Assigning a Drive

To assign a drive letter to a group of partitioned data sets on the mainframe, all with the same search criteria:

  1. Click the SourceConnect tab.

  2. Click Add.

    The Add dialog box appears.

    The next available drive letter on your PC appears in the Drive field. The next available letter is the first letter in the alphabet that isn't the name of a drive on your own PC and that you haven't assigned to a drive on another PC across the network. If you want to choose a different letter, click it to get a pulldown list.

    In the following, we will use my-datasets to refer to the part of the data set names that is common to all your data sets, as we did in the previous chapter, Uploading and Downloading Files.

  3. Enter the following in the Mainframe Catalog Search Criteria field: my-datasets.DEMO*.

    For example, if my-datasets is MF101.MTS, type MF101.MTS.DEMO*

  4. Make sure that the Node field contains the name of the node you defined in the section Specifying the Communications Link, then click OK.

Once you have assigned a drive letter using SourceConnect, it stays assigned until you use SourceConnect to remove it. Closing Mainframe Express, or even rebooting your PC, does not affect it. If you want to remove an assigned drive, select its entry and click Delete.

Whenever you are using Mainframe Express, if a drive letter you have assigned using SourceConnect clashes with one you have subsequently assigned to a network drive, you will from time to time get a warning message.

Don't click OK on the Server Access Configuration dialog box yet - there's more to do in the next section.

10.3.2.2 Setting Global Extension Overrides

Since files on the mainframe don't have extensions to show file type, you need a way for Mainframe Express to recognize what type of file it is dealing with when it accesses a mainframe file. You do this by associating data set names with extensions. This is called a global extension override.

To set a global extension override:

  1. Click Configure your datasets.

    The Dataset Configuration dialog box appears.

  2. Click the Extensions tab.

  3. Click Add.

  4. Type COBOL in the Mainframe type to override field.

  5. Type CBL in the Associated workstation extension field, and click Add.

    This specifies that any member of a data set whose name ends in .COBOL is to be treated like a PC file with extension .cbl.

  6. Click Add, then click OK.

  7. Click OK to close the Server Access Configuration dialog box.

10.3.3 Creating a Project

We'll now create a project just like in the chapter Using Mainframe Express. The files for this demo are in \mfuser\projects\gsdemo\scondemo. The files in this folder are just the same as those used in the chapter Using Mainframe Express, with the following exceptions:

To create the project:

  1. Click New on the File menu, then select Project on the New dialog box and click OK.

  2. Enter scondemo as the name of the project and change the name of the Project Folder to \mfuser\projects\gsdemo\scondemo, then click Next.

  3. Accept the default Using this wizard and click Next.

  4. Leave the default folder for the catalog unchanged, and click Next.

    If you installed any of the Mainframe Express options, such as CICS Option or SQL Option, you now get a page asking which of them it uses. There is a check box for each option installed. This project uses none of them.

  5. If you got this page, click each check box to delete the check mark, and click Next.

  6. Click Finish.

10.3.4 Adding Files to the Project

To add your files to the project:

  1. Click Add Files on the Project menu.

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

  3. Select scondemo.jcl, then click Add.

    Next we add the mainframe file to the project. Rather than entering its path and name in the Filename field, we will navigate the hierarchy of folders and drives to specify that it is on the mainframe, as follows.

  4. Click the Up One Level g button on the Add Files to Project dialog box several times, until the Add from field to its left shows My Computer.

  5. Double-click My Mainframe 2.5.

    The My Mainframe 2.5 icon was added to My Computer when you installed Mainframe Express.

  6. Double-click Catalog: my-datasets.DEMO*.

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

  7. If you do get this dialog box, enter the user ID and password and click OK.

    There may be a few seconds delay before the mainframe is contacted and the display in the dialog box changes.

  8. Double-click my-datasets.DEMO.COBOL.

    You now see a list of the members of my-datasets.DEMO.COBOL, just as if it were a PC directory and they were the files in it. Notice that the COBOL source files are shown with a .cbl extension.

  9. Select vsamdemo.cbl, then click Add.

  10. Click Done. The two source files are parsed.

10.3.5 Modifying scondemo.jcl

Before continuing, you need to edit scondemo.jcl to specify the part of the data set names that is common to all your data sets; my-datasets. This change is only required for my-datasets.VSAMDEMO.INQUIRY.DATA, as that is the only mainframe-based file that scondemo.jcl refers to.

To modify scondemo.jcl:

  1. Double-click scondemo.jcl in the Files View.

  2. Modify the \\INQUIRY line (line 13), changing USERID to the value you used for my-datasets when you created my-datasets.VSAMDEMO.INQUIRY.DATA.

  3. Click Save on the File menu.

  4. Click Close on the File menu.

10.3.6 Adding Input Files to the Catalog

We now need to add the data files to the project's catalog. First we'll add the data file held on the mainframe, my-datasets.VSAMDEMO.INQUIRY.DATA, then we'll add the other two files, which are on the PC.

  1. Click the Catalog tab at the bottom of the project window.

  2. Right-click on the Catalog View, and on the popup menu click Add Existing Dataset.

  3. On the dialog box, enter my-datasets.VSAMDEMO.INQUIRY.DATA in the DS Name (data set name) field.

  4. Enter the value $$node-name\my-datasets.VSAMDEMO.INQUIRY.DATA in the PC Filename field, where node-name is the name that you defined in the Server Access Configuration dialog box in the section Specifying the Communications Link.

    For example, if node-name is MVS-PROD, and my-datasets is MF101.MTS, enter $$MVS-PROD\MF101.MTS.VSAMDEMO.INQUIRY.DATA in this field.

    For a mainframe dataset, you can't use the Browse button g to set the PC Filename field. You must type the name.

  5. Leave the default PS in the DSORG (organization) field.

  6. Change the RECFM (record format) field to VB.

  7. Change the LRECL (record length) field to 534.

  8. Click OK.

    The file is added to the catalog. Its details appear in the Catalog View.

  9. Add the other two files to the catalog using Add Existing Dataset as described in the chapter Using Mainframe Express. The files are:

    DS Name PC Filename DSORG RECFM LRECL
    VSAMDEMO.SALEDATA.DATA saledata.dat PS FB 26
    VSAMDEMO.VSAMINIT.DATA vsaminit.dat PS FB 80

    As these files are on your PC, you can use the g button to include the full path \mfuser\projects\gsdemo\scondemo\data in the PC Filename field.

10.3.7 Completing the Project

If you wish, add the two input files on the PC to the Files View as you did when you worked through the tutorial in the chapter Using Mainframe Express. However, if you try to do this with the data file on the host, it has no effect; you cannot add a data file on the host to the Files View.

You have now created a project just as you did in the chapter Using Mainframe Express, except that vsamdemo.cbl and my-datasets.VSAMDEMO.INQUIRY.DATA are on the mainframe. You can use this project in just the same way - you can build, run, and debug it. You can treat vsamdemo.cbl just as if it were on the PC. You can edit it and compile it. You can open it using Open or Recent Files on the File menu when this is more convenient than via a project, and so on. However, you cannot edit a data file that is on the host.

If access to the mainframe takes an appreciable time, messages at the bottom left of the IDE keep you informed of the progress of the access.

We will build and run this project before looking at a further facility.

10.3.8 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".


Note: If building the project results in two build errors, you are probably using an unedited version of vsamdemo.cbl. For information on resolving the two errors, see the section Editing the Source Errors and Rebuilding in the chapter Using Mainframe Express.


10.3.9 Running the Application

To run the jobstream:

  1. In the Files View, click scondemo.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.

10.3.10 Using Automatic Mainframe Lookup

Once you have satisfied yourself that you have full access to these files, you can alter the project to enable automatic mainframe lookup. We'll now delete the catalog entry for my-datasets.VSAMDEMO.INQUIRY.DATA and instruct Mainframe Express to look on the mainframe for any input files not in the catalog:

  1. Click the Catalog tab at the bottom of the project window.

  2. Right-click on the entry for my-datasets.VSAMDEMO.INQUIRY.DATA in the Catalog View, and on the popup menu click Delete.

  3. On the Delete Catalog Entries dialog box, make sure that the Also delete associated data file(s) check box is not checked and click OK.

  4. Click Project Settings on the Project menu.

  5. Click the Catalog tab and the General subtab.

  6. Check Enable DataConnect lookup when dataset not found.

  7. In the Node for lookup field, click the node you defined in the section Specifying the Communications Link if it is not already selected.

  8. Click OK.

10.3.11 Running the Application Again

Run the project again, as above. When the data set my-datasets.VSAMDEMO.INQUIRY.DATA is allocated, Mainframe Express looks for it on the mainframe and creates a catalog entry for it. The application then runs as before.

10.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.


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.