PreviousUploading and Downloading Files Running JCL on the MainframeNext"

Chapter 10: Accessing Mainframe Files

From your PC, use the Micro Focus product Mainframe Access from within Mainframe Express to view and access data sets held on the mainframe. You can access sequential data sets, which hold data input to and output from your programs, and partitioned data sets, which hold source code. Partitioned data sets include Librarian, Panvalet, and in-house source control systems.

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 a separate Micro Focus Mainframe Access Server product running on the mainframe. Before running this session, check that your site intends to use this product rather than some other method of accessing mainframe files. More information is supplied with the Mainframe Access product.

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 drive 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 Mainframe Access on the Options menu.

    The SourceConnect Configuration dialog box appears.

Don't click OK yet - there's more to do in the next section.

10.3.2 Configuring SourceConnect

For SourceConnect there are two further configuration actions: 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. Change the Category field to Mainframe Drives.

    This is where you assign the drive letter.

  2. Click New

    The next available drive letter on your PC appears in the Drive column in the listbox.

    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 wanted to choose a different letter you could 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. Click the Catalog Search Criteria field to select it, then click it again to open it for input, and then enter my-datasets.DEMO*.

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

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

Don't click OK yet - there's more to do in the next section. 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. Change the Category field to Global Extension Overrides.

  2. Click New.

    The Mainframe Type to Override column is selected.

  3. Type COBOL.

  4. Click in the Associated Workstation Extension column to select it, then type CBL and press Enter.

    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.

  5. Click OK.

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 and they are just the same as those used in the chapter Using Mainframe Express except that vsamdemo.cbl and salesinq.dat are not included. These two files will be accessed on the mainframe, where you put them in the previous chapter, Uploading and Downloading Files.

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 wizard pages 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 vsamdemo.jcl, then click Add.

    Next we add the mainframe file to the project. To access a drive on the mainframe, you must indicate explicitly that it's on the mainframe. You can't simply enter its path and name in the Filename field (which was one of the methods described in the appendix Windows Tips for changing drive or folder). You must go up 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.0.

    The My Mainframe 2.0 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 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, 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 VSAMDEMO.INQUIRY.DATA in the DS Name (data set name) field.

  4. Enter the value $$standard-server-name\my-datasets.VSAMDEMO.INQUIRY.DATA in the PC Filename field, where standard-server-name is the name of your Standard Mainframe Access Server.

    For example, if standard-server-name is FILESHR2.CSIMVS, and my-datasets is MF101.MTS, enter $$FILESHR2.CSIMVS\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:

    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.6 Completing the Project

If you wish, add the input files to the Files View as you did when you worked through the tutorial in the chapter Using Mainframe Express.

You have now created a project just as you did in the chapter Using Mainframe Express, except that vsamdemo.cbl and 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 and VSAMDEMO.INQUIRY.DATA just like files on the PC. You can view and edit them and you can compile vsamdemo.cbl. You can open them using Open or Recent Files on the File menu when this is more convenient than via a project, and so on.

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

10.3.8 Running the Application

To run the jobstream:

  1. In the Files View, click vsamdemo.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.9 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 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 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. Click OK.

10.3.10 Running the Application Again

Run the project again, as above. When the data set 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.

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

PreviousUploading and Downloading Files Running JCL on the MainframeNext"