Large Scale Computing Lab - Widener University 3

Lab 1

CSCI 388 – Introduction to Large Scale Computing, Lab 1

Connection to Marist College System z9

Prepared by:

Noah Pascarell |

Lab 1C

Content based on IBM’s ‘Master the Mainframe Contest’.

Overview

In this lab you will familiarize yourself with the IBM z9 mainframe and some of the basic commands and functions within it. The different sections will utilize screenshots for the majority of the steps involved. Lab 1 includes the following sections:

Lab 1A

(1.)  Download and install a 3270 emulator

(2.)  Use the emulator to connect to the mainframe

(3.)  Logon to z/OS using your ID

(4.)  Customize your environment

Lab 1B

(5a.) Use ISPF facilities to locate data sets

(5b.) Allocate a data set
(6.) Populate your data set with a member
(7.) Enter three lines of text into your new data set member
(8.) Use the ISPF editor to manipulate text

Lab 1C

(9.) Create and run a COBOL program

This document covers Lab 1C

Large Scale Computing Lab – Widener University 2006-2007 3

Large Scale Computing Lab - Widener University 3

Lab 1

(9.) Create and run a COBOL program

(9a.) Create datasets for the Cobol Code, JCL and resulting Executable
To create and run your first COBOL program you will need to use all the skills you have gained thus far in the lab. The COBOL programs we will be running will be run in batch (basically, non-interactive background execution). To do this you will first need to create 3 data sets:

·  Create a data set for the COBOL program – ex. KC03H##.HELLO.COBOL

·  Create a data set for the JCL to compile/run the program – ex. KC03H##.HELLO.JCL

·  Create a data set for the resulting executable – ex. KC03H##.HELLO.LOAD

Create each of these the same way we created your first data set in step 5b. Once you have created all three data sets, do a DSLIST (option 3.4 from the main ISPF screen) on your USERID. You should now see those three data sets you just created:

(9b.) Create the COBOL source program
Now that you have created the data sets, let’s start by writing the source code for the COBOL program. The code will go in a new member within the KC03H##.HELLO.COBOL data set. Using step 6 as an example, create a new member called first in your data set. Then use your text-entering skills to type the following COBOL source into you newly created member (notice that line numbers are automatically created and updated for you, so be careful to enter your text accordingly)

Tip: on the command line type HILITE COBOL to turn syntax highlighting on.

(9C.) Create the JCL
Next you will need to create a first member within your KC03H##.HELLO.JCL data set. This will contain the JCL used to run the COBOL program. JCL or Job Control Language is used to initiate everything involved in executing a program and then to execute it. Enter the following JCL code in your new member:

Tip: on the command line type HILITE JCL to turn syntax highlighting on.

(9D.) Execute the JCL
To execute the JCL type the command ‘SUBMIT’ on the command line (Command===>).

(9E.) View the results from executing the JCL

From the top level in ISPF, execute command 13 (SDSF). Select O (to view output from the batch job). You can Filter based on owner (your account id), then you should be able to see the output “MYHELLO” – that was the name of the JOB (you can see this in the JCL).

To view the output, one you can enter an “?” in the left column prior to the name of the output.


This will show all the steps (tasks) within that JCL. To view the actual output, one enters an “s” to the left of the desired procStep. You might want to review output from the “GO” step (the “COBOL” procedure step is for compiling the code, the “LKED” is to link the object code, and the “GO” step is to run the program).



So entering an “s” to the left of the “GO” ProcStep will show the output of the “GO” (execution) of your hello world program. When you see the output below you have successfully compiled and run a COBOL program. If you do not see this, then perhaps there was an error in the compilation of the COBOL program. So, look at the output from the COBOL and then the LKED steps of the JCL.

Congratulations, you have now successfully learned how to navigate an IBM system Z9 mainframe, create data sets and members, enter and edit text, and how create a COBOL program with its corresponding JCL code.

10. EXTRA: Creating an interactive Cobol Program

Modify the simple “hello world” program you created in the previous task to be an interactive (i.e. online verses batch) program. Note that since this is an interactive program, you can not use JCL (see CH 18 from your reading assignment).

Large Scale Computing Lab – Widener University 2006-2007 3