Mainframe Express Data Files

Mainframe Express (MFE) executes assembler programs by simulating the mainframe environment. To run a program on the mainframe that uses data files, it is necessary to create the input file(s) using the MFE Data File Editor. This allows you to create files in EBCDIC, and it also adds your files to the Catalog. The Catalog simulates the mainframe Catalog, which keeps track of files on a mainframe. You must also add your output files to the Catalog. To run or debug your program it is necessary to invoke the program with a script that associates actual disk files with the files defined in the program. There are several different mainframe environments that support different scripting languages. MFE supports three scripting languages: JCL (from the MVS operating system), CLIST (from the TSO timesharing system), and REXX (from the CMS operating system). We will use CLISTs for our labs.

There are four steps required to create data files and run an Assembler program that uses them. These steps are in addition to the steps in the Mainframe Express handout. The method of executing the program is slightly different from the method described in the Mainframe Express handout. If your program uses data files, use the execution method described in this handout.

The additional/modified steps required are:

Creating the Input File(s) Using the Data File Editor

The MFE Data File editor can create data files in ASCII (also called ANSI) and EBCDIC. To create a data file in EBCDIC:

  1. Click New on the File menu, or click on the New button image of New button on the toolbar.
  2. In the dialog box that appears, click Data File, then click OK.
  3. The first page of the Project Wizard appears. Enter a name for your file in the DS name field. Choose a name that is descriptive, and end the name with the extension .DATA. Click on the Browse button next to the PC filename field. This opens a Save As window, which is open to the project folder. Double click on the Data folder so that your file will be created in this folder. Enter a name for the disk file to be created and click on Save. Make sure that the DSORG field is set to PS, the RECFM field is set to FB, and the Char field is set to EBCDIC. Set the Max length field to the record length of the file being created. Click on Create.
  4. The Data File Editor window appears. The title bar has the DS name that you chose. The body of the window contains the message "File empty." To start entering data, press F3. The first line of the window will now be highlighted. Type your first record on this line. Make sure that you use the number of columns specified in the record layout.
  5. For each record you want to enter, press F3, and then type in the data for that record.
  6. When you have entered all your data, choose Save from the File menu or click on the Save button on the toolbar. Then close the Data File Editor.
  7. To access your data file again, choose the Catalog tab at the bottom of the Project window. Double clicking on the file in the Catalog will open the editor again.
  8. If your program uses more than one input file, repeat these steps for each input file.

Adding the Output File(s) to the Catalog

The output file(s) will be created by your program, but you need to enter each output file in the catalog before you execute your program.

To add an output file to the catalog:

  1. choose the Catalog tab at the bottom of the Project window. Right click in the Catalog window and choose Allocate from the popup menu.
  2. The Allocate Dataset window appears. In the DS name field, enter a descriptive name for your output file. End the name with the extension .DATA. Make sure that the DSORG field is set to PS, and the RECFM field is set to FB Set the LRECL field to the record length of the output file. Click on OK.

Creating a CLIST

The CLIST tells MFE what program to run and which data files to use. Each CLIST will be a little different because you will need to change the name of the data files and the program. Here is a sample CLIST:

PROC 0
CONTROL NOMSG
DELETE 'catalognameout'
CONTROL MSG
ALLOC F(ddnamein) DA('catalognamein') SHR
ALLOC F(ddnameout) DA('catalognameout') NEW LRECL(lrecl)
CALL program

You must substitute your data where ever the above example contains lowercase letters:

  1. Replace catalognameout with the DS Name you chose for the output file. To see the DS Name, look in the Catalog window. Notice that catalognameout appears twice in the CLIST.
  2. Replace ddnamein with the name you entered in your program as the DDNAME operand in the DCB statement for the input file.
  3. Replace catalognamein with the DS Name you chose for the input file. To see the DS Name, look in the Catalog window.
  4. Replace ddnameout with the name you entered in your program as the DDNAME operand in the DCB statement for the output file.
  5. Replace lrecl with the record length of the output file. To see the lrecl, look at the DCB statement for the output file, or look at the Lrecl field in the Catalog entry for the output file.
  6. Replace program with the name of the file that contains your assembler program. Do not include the .mlc extension; just use the name portion of the filename.

To create the CLIST:

  1. Click New on the File menu, or click on the New button image of New button on the toolbar.
  2. In the dialog box that appears, click Source File, then click OK.
  3. Type in the sample CLIST shown above, including the substitutions described above. Start each CLIST command in position 1. To make it easier to type in the CLIST, type in the first line and then save the CLIST, using a filename with the extension .TSO.
  4. Right click in the CLIST edit window and choose Add to Project from the popup menu.
  5. Save the CLIST file when you are done entering your CLIST.

Executing Your Program

To execute or debug the program, you need to run the CLIST created for the project.

  1. Click Run or Start Debugging on the Debug menu, or click on the Run button image of Run button.
  2. In the Start Debugging dialog box, check Enable Assembler Debugging.
  3. Your CLIST should appear in the Clist field. If it does not, type in the path (starting from A:) and name of the CLIST file. Then click on OK.
  4. The Application Output window appears. After a short delay, it displays the Assembler Debugger, which is also called the Animator. Use the Animator to execute your program, as described in the Mainframe Express handout.
  5. When your program is finished, you will be back in MFE. Go to the Catalog tab in the Project window. Double click on the output file. This will open a Data File Editor window for the output file. To print the output file, choose Print from the File menu, or click on the Print button on the toolbar. This opens the Print window. Under Print range, select All records and Whole record, then click on Print.

Email Me | Office Hours | My Home Page | Department Home | MCC Home Page

© Copyright Emmi Schatz 2003