Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Mainframe Hands-On Exercises For IBMers - Part Two PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 75

Mainframe Hands On Exercises 4 IBMers

(Part Two: Practical Experience)

Copyright IBM Corporation, 2007


This document is intended for IBM internal use only.

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

This page intentionally left blank

Copyright IBM Corporation, 2007

Page 1 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

TABLE OF
OF CONTENTS

INTRODUCTION ................................................................................................................ 3
BEFORE YOU BEGIN: WHERE
WHERE TO LOOK FOR HELP .......................................................... 3
(1.) PRIME YOUR PART 2 DATA SET..................................................................................
4
SET
(2.) RUN A REXX PROGRAM
6
PROGRAM USING JCL............................................................................
JCL
(3.) DEBUG BROKEN JCL .................................................................................................. 12
(4.) TRACK DOWN THE TCP/IP CONFIGURATION VIA ACTIVE PROC..........................
13
PROC
(5.) INTRODUCTION TO SYSCMDS (SYSTEM COMMANDS)
COMMANDS) ........................................ 16
(6.) TRACK DOWN THE TCP/IP CONFIGURATION
CONFIGURATION VIA SYSCMDS ................................ 17
(7.) IN SEARCH OF STORAGE
18
STORAGE (DFSMS)............................................................................
(DFSMS)
(8.) WRITE YOUR OWN ISPF PANEL................................................................................
22
PANEL
(9.) ISPF AND REXX PROGRAMMING
PROGRAMMING CHALLENGE ........................................................ 27
(10.) TRICKIER JCL ERROR
ERROR ............................................................................................... 37
(11.) COMPILE ASSEMBLER,
ASSEMBLER, COBOL, PL1 AND C USING JCL ........................................ 38
(12.) WHAT'S NEXT? ........................................................................................................ 49
SOLUTIONS TO EXERCISES
EXERCISES .............................................................................................. 51

Copyright IBM Corporation, 2007

Page 2 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

INTRODUCTION
Approximate time to completion: less than a day (if you are new to the mainframe plan to
spend more time to understand the material)

You must complete Part 1 of this exercise before beginning Part 2.


The objective of this part is to get you acquainted with some of the more practical aspects of systems
programming and application development on the mainframe. These challenges are modeled after
tasks that are commonly performed in z/OS environments.
The instructions are not nearly as detailed for this part of the contest. This will require some
additional knowledge, along with your new-found mainframe expertise, to complete the challenges.
Good Luck!

Before you begin: Where to look for help


If you encounter any problems during the contest, or need to find out more about mainframes, refer
to the following helpful mainframe resources:

Introduction to the New Mainframe: A new college textbook; great for introductory and
overview information about the mainframe
(http://publibz.boulder.ibm.com/zoslib/pdf/zosbasic.pdf)

z/OS Library Center: Contains all of IBM's official technical documentation on z/OS, with
hundreds upon hundreds of searchable books and documents. Everything you'd ever need to
know about mainframes can be found here.
(http://publibz.boulder.ibm.com/bookmgr_OS390/libraryserver/zosv1r7/)

ABCs of System Programming, Volume 9: Written by system users, this is a great resource for
systems programmers. (http://www.redbooks.ibm.com/redpieces/pdfs/sg246989.pdf)

Message Look At Facility: If you receive an error message from the system, you can look up a

Copyright IBM Corporation, 2007

Page 3 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

detailed explanation of the error here. (http://www03.ibm.com/servers/eserver/zseries/zos/bkserv/lookat/)

Mainframe Blog : A mainframe blog that gives you a chance to interact with other mainframe
enthusiasts. (http://mainframe.typepad.com/)

Z/OS Hot Topics newsletters: Keep up on the latest technical news about z/OS. (http://www03.ibm.com/servers/eserver/zseries/zos/bkserv/hot_topics.html)

(1.) Prime your Part 2 data set


Background: You're familiar with using ISPF panels by now. Refer to "Part 1: Breaking the Ice," if you
need a refresher.
For Part 2 you will need to create a data set called 'VITALITY.DNET###.COMPETE.PARTTWO'
(where DNET### is your assigned z/OS userid).
__1. Create this data set as you did in part 1. This data set is very important. It will be used to store
all of your work for Part 2. From here on out, we will refer to this data set as your
COMPETE.PARTTWO data set.

Copyright IBM Corporation, 2007

Page 4 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Your Challenge:
Challenge:
__2. Go to the DSLIST panel (ISPF option 3.4) and enter VITALITY.DNET### in the Dsname Level
field, where DNET### is your assigned z/OS userid. On the next panel, put an E next to your
COMPETE.PARTTWO data set and you should see a yellow message that says "No members in
data set" because this data set currently contains no members.

Let's use what you've learned from Part 1 to create a member in this data set. (Remember ISPF option
2?)
__3. Create a member in your COMPETE.PARTTWO data set named DUMMY. Insert at least one
character of text into DUMMY, then F3 out of it.
__4. Now go back to the list of all the data sets that begin with your VITALITY.DNET### ID. Put an
E beside COMPETE.PARTTWO. No more error message!
Now your data set should have a new member named DUMMY.
__5. On the command line, type S or SEL (select) NEWMEMBR. In the editor session that
Copyright IBM Corporation, 2007

Page 5 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

automatically opens, enter "DNET### WAS HERE 2007.


__6. F3 back out, and you'll see that NEWMEMBR has been created in your COMPETE.PARTTWO
data set, and you didn't have to go through the longer process needed to create the DUMMY
member.

You have just completed the first challenge! Congratulations!!!

(2.) Run a REXX program using JCL


Background: In "Part 1: Breaking the Ice," you ran a simple REXX program from the command
panel. Now we are going to run that same REXX program in batch. In z/OS, you have two different
ways to do work: interactively in the foreground or non-interactively in the background. All of your
work from Part 1 was considered foreground work. You can do a lot of stuff in the foreground, but
if a program takes any length of time to process, you can't do anything else with your session while
it's running. If you submit long-running programs in batch, however, you can still continue to use
the foreground while your work runs in the background.
In order to submit work to run in batch, you need to instruct z/OS through JCL (Job Control
Language). You submit your JCL to JES (Job Entry Subsystem), and the system allocates the necessary
Copyright IBM Corporation, 2007

Page 6 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

resources for your job, and then executes the work. JCL is a very rich language, and it's very
different from any other programming language. JCL has been around for over 30 years; as you
might imagine, JCL for just about every conceivable task has already been written. Most systems
programmers will find a JCL file (normally called a "job" in mainframe-speak) that does something
very close to what they want to do, and then make a few little changes to it so that it fits their needs.
You're going to do the same thing.
Your Challenge:
Challenge: You have read-only access to a group of data sets on the system named
VITALITY.ZOS.CONTEST.
__1. To access these data sets, use the ISPF Menu option 3.4, just as you did in Part 1. Go to the data
set called VITALITY.ZOS.CONTEST.JCL. The member RUNREXX in this data set contains JCL
that is very close to what you need. Copy this member into your own DNET###.JCL data set
so that you can edit it.
__2. Open the VITALITY.ZOS.CONTEST.JCL data set, then view the RUNREXX member by putting a
V beside it (E for Edit will also work, but any changes you make will not be saved because you
are working in a read-only member).
__3. Tell the system which text you'd like to copy into the new data set member. You can do this
using the CC tags you learned in Part 1 (you can also use C### beside the first line of JCL,
where ### is the number of lines you'd like to copy. If ### is higher than the number of
lines in the member, then C### will copy the entire member.)
__4. On the command line, run the command CREATE VITALITY.DNET### JCL (RUNREXX).
Remember, the system automatically uses your DNET### ID as the high-level qualifier if you
do not put single quotes around the data set name. This command will copy the text you
specified using the C### or CC tags into your own VITALITY.DNET###. JCL data set, with
the member name of RUNREXX.

Copyright IBM Corporation, 2007

Page 7 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__5. Once you've copied RUNREXX into your own data set, open it with the ISPF editor. Make these
changes:
__6. Change jobname to REXX followed by the last three numbers in your ID. For example, if your
Copyright IBM Corporation, 2007

Page 8 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

ID is DNET001, your jobname would be REXX001.

__7. Change BLA.CLIST on the line that starts with //SYSEXEC to VITALITY.ZOS.CONTEST.REXX.
Make sure not to overwrite ",DISP=SHR" or you may make a JCL error for yourself! (You can
use the insert key on your keyboard to change the cursor mode. In the Vista emulator, the Ctrl
button changes the cursor mode back to overwrite.)
__8. Change user_id to your DNET### ID.
__9. Change member_nam to the name that you called the member that you made in Part 1. (In the
examples for Part 1, the member was named OGE.)
__10. On the command line, type SUB (submit) and press Ctrl. This will send your job to JES for
processing.

But where do you find out what happened when your job ran? The answer is SDSF,
SDSF which means
Spool Display and Search Facility.
Facility
__11. To get to SDSF on this system, type =13.14 on the Option line.
__12. At the main SDSF prompt, enter the command: OWNER DNET###. This makes only your
Copyright IBM Corporation, 2007

Page 9 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

jobs visible to you. To see all the jobs in your held output queue, enter H ALL. View your
output, along with some system-generated output, by putting a ? beside your job (the
JOBNAME specified in your JCL job was REXX####) and pressing Ctrl.

__13. Put an S (select) beside each piece here to see what happened when you ran your job. Now
back out to the screen that lists REXX### in the held output queue. Put an S beside REXX###
and press Ctrl. What you'll see now is the same output from when you specified ?. This time,
though, it's all concatenated (linked together) into one display for easier viewing.

Copyright IBM Corporation, 2007

Page 10 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__14. After verifying that your job produced the same output that it did in "Part 1: Breaking the
Ice," write out all of the output to a member of your
VITALITY.DNET###.COMPETE.PARTTWO data set called REXXRUN. To do this, use the XDC
command next to the job. Make sure that you type XDC right next to the REXX### output
and press Ctrl.

Copyright IBM Corporation, 2007

Page 11 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

This will ensure that the concatenated JESMSGLG, JESJCL, JESYSMSG, SYSTSPRT, and OUTDD are all
sent as a single member to your VITALITY.DNET###.COMPETE.PARTTWO data set.
__15. From the XDC menu, correctly specify the target data set name, target member to use and
disposition (OLD). You can accept all the other defaults and press Ctrl.

__16. Now find a new member in your COMPETE.PARTTWO data set. You just completed another
challenge

(3.) Debug broken JCL


Background:
As a systems programmer, you will be doing lots of work with JCL. If you make a simple JCL error,
such as forgetting a comma or coding a JCL statement that runs past column 71, your job will, in
most cases, end very quickly, and the system will inform you of a JCL error.
Your Challenge:
Challenge:
__1. Fix a simple JCL error. Copy VITALITY.ZOS.CONTEST.JCL(BADJCL) to your own
VITALITY.DNET###.JCL data set.
Copyright IBM Corporation, 2007

Page 12 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__2. Open your member in the ISPF editor and change jobname to DBJB###, where ### is the
last three numbers in your ID. Submit the job. You'll get a JCL error. What gives?
__3. Check your output in SDSF and fix the error. Remember to use the H ALL command to see
your held output.

Hint: Plug the message ID from JESYSMSG into the LookAt Facility for some help (the message ID
starts with IEF). The system you are currently using is z/OS, release level V1R7. You can also
compare BADJCL with RUNREXX, which you already know runs correctly.
__4. After you fix the error and get the job to run correctly with no JCL errors, go back to SDSF.
You'll find a new piece of held output there.
__5. Once you verify that you got this new output, XDC all of the output from the job into your
COMPETE.PARTTWO data set under the member name FIXEDJCL. Again, be sure that you
XDC from beside the JOBNAME (not the DDNAME), to ensure that your new member will
contain JESMSGLG, JESJCL and JESYSMSG, as well as the new piece of output.
That's it! You just debugged a JCL job!!!

(4.) Track down the TCP/IP configuration via Active Proc


Background:
As a systems programmer, you might be called on to fix a system that you aren't familiar with,
or you may have several systems to keep track of. In either case, you'll need to know how to look
up configuration information.
Navigation tip: To aid your navigation for this challenge, it's time you learned about screen
splitting.
From any ISPF panel, move your cursor to the topmost line and press the F2 key. You will notice
that a brand new ISPF Primary Option Menu has appeared, and there is a row of dots across the
top. You just started a second screen, which you can use just like you would a normal screen. To
toggle between your two screens, use the F9 key. You might find this newfound knowledge
helpful when you're comparing data sets, or copying output from one member into another.
When you're done with your second screen, just hit F3 until you back all the way out of it. Your
Copyright IBM Corporation, 2007

Page 13 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

second screen will disappear, leaving you with only your original screen.
Your Challenge:
Challenge: Track down the TCP/IP configuration on this system.
There are several ways to find this information. The first place we are going to look is the active
TCP/IP procedure. Through SDSF, we can find the configuration data set used when the system
was booted up, or, in mainframe-speak, IPLed (IPL = Initial Program Load).
To find the TCP/IP configuration information, complete each of the following steps:
__1. From the SDSF main prompt, input this command: OWNER *. Now all of the jobs on the
system, not just yours, will be visible to you.
__2. Find the TCPIP procedure (also called a proc, or task) through the "Active users" list. Look
at the JCL that was submitted to start the task.
You'll notice that most of the job has been commented out with * on column 3 of each line.
However, there is a lot of JCL that was used to run the task.
__3. Find the active PROFILE DD card ("card" is mainframe-speak for "statement"). You'll see a
data set name here. (If you're having trouble finding the PROFILE DD card, running the
command F (for find) PROFILE could help. F5 cycles through all found instances of the
word PROFILE.)

Copyright IBM Corporation, 2007

Page 14 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__4. Open the data set member that the PROFILE DD card points to.
__5. Once inside that data set member, find the two lines of active information (a semi-colon
denotes a comment here) from the hardware definitions.
These lines are the DEVICE and LINK definitions for the active network interface.
__6. Now find one line that contains the IP address for that interface. Copy these three lines
into a new member called TCPCONF in your COMPETE.PARTTWO data set. There are
many different ways to copy this information. One tool you may find useful is using your
mouse to select a block of text, then choosing Edit --> Copy on your 3270 emulator (then
you can Edit --> Paste into your new member).
__7. You can enter TSO commands from the command line of most any ISPF panel by prefixing
the command with "TSO". Use the TSO nslookup tool to do a reverse lookup of the IP
address that you found for the CTC1 interface. To use nslookup, simply enter the
command TSO NSLOOKUP ip_address, where ip_address is (you guessed it!) the IP
address that you just found.
__8. Put the two lines of hostname information from the nslookup command's output at the
bottom of your TCPCONF member.

Hint: If you see a couple of IP addresses to choose from here, be sure to pick the one that
matches the CTC1 interface IP address. If you copy the IP address from the nslookup command
output, and it doesn't match the IP address that you entered with the nslookup command, you
are about to knock yourself out of this part of the contest.

Copyright IBM Corporation, 2007

Page 15 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Your TCPCONF member should now have five lines of system configuration information in it if
you tracked down all five lines.

(5.) Introduction to SYSCMDs (System Commands)


Background: Tired of staring at this page yet? Let's take a little break from it.
Your Challenge:
Challenge: Your next challenge, should you choose to accept it, is waiting for you in
VITALITY.CONTEST.QUIZ(SYSCMDS).
__1. Copy SYSCMDS into your COMPETE.PARTTWO data set. Follow the instructions, entering
your answers into your copy of the SYSCMDS member as you go. (Using screen splitting
and cut/paste will help you finish this challenge faster.) Good luck!

Copyright IBM Corporation, 2007

Page 16 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

(6.) Track down the TCP/IP configuration via SYSCMDs


Background:
In this challenge, you are going to find the TCP/IP information that you found in Challenge 4,
Copyright IBM Corporation, 2007

Page 17 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

but this time you're going to use system commands, like the ones you just used in the previous
challenge. You are also going to be able to track down some more information about the active
TCP/IP stack.
Your Challenge:
Challenge: Refer to the TCP/IP command summary and issue commands in TSO to collect
the following information:
__1. The IP address(es) for the TCP/IP stack
__2. Device and link status for the TCP/IP stack (for the active adaptor)
__3. The routing table for the TCP/IP stack (copy the entire table)
__4. Contents of ARP cache for the TCP/IP stack

Hint: Remember that in Challenge 4, you discovered that the name of the TCP/IP proc was
TCPIP.
__5. Save all of the appropriate output from those commands to a new member called
SYCMDTCP in your COMPETE.PARTTWO data set. (Using screen splitting and cut/paste
will help you finish this challenge faster, too.)
Once you've collected the information you need, you're done with this challenge! Well done!!!
Let's try some new things now.

(7.) In Search of Storage (DFSMS)


Background:
Data management on high-availability systems entails a lot more than just making sure you
have a big enough hard drive. A single instance of z/OS may be accessing several hundred
different volumes (you can think of a volume as a logical hard drive) of storage at any given
time. Obviously, keeping track of storage like this is an enormous task, so mainframe systems
programmers make use of IBM's DFSMS, the Data Facility Storage Management Subsystem.
Through the facilities provided by DFSMS, storage becomes much more flexible and
Copyright IBM Corporation, 2007

Page 18 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

manageable.
One benefit that DFSMS offers is the ability to logically group volumes into storage groups. A
storage group is a grouping of volumes, defined by the storage administrator that will form a
single larger entity. For example, say you have a DB2 (database) application that requires lots of
space to write out its records. It requires so much space, in fact, that the content would span
several of your largest storage volumes. With DFSMS, you could define a storage group called
DB2OUT, and allocate enough volumes to contain the output. Now your DB2 application
simply has to specify that its output will be written to DB2OUT, and everything will fit in that
group. If more space is needed later on, additional volumes can be added, without the need to
re-initialize the existing volumes.
Many of DFSMS's interfaces are located in the ISMF (Interactive Storage Management Facility)
panels of ISPF. Let's check them out!
Your Challenge: Complete the following steps:
__1. Create a new member in your VITALITY.DNETXXX.COMPETE.PARTTWO data set called
DFSMS. You'll be placing your written answers here.
__2. From the ISPF Primary Option menu, select option 6, to enter TSO commands to enable
you to access the ISMF panels.

Copyright IBM Corporation, 2007

Page 19 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__3. In the ISPF command shell the command DGTFMD01 and press the control key. You will
now see the ISMF Primary Option Menu!

__4. Select Option 2 (Volume), then option 1 (DASD). This will bring you to the VOLUME
SELECTION ENTRY PANEL, where you can enter search criteria for the storage volumes
you want to find out more about.
__5. Specify "Y" in the Acquire Physical Data and Acquire Space Data fields, and put * in the
Storage Group Name field and press Ctrl. This ensures that you'll be able to find see the
Storage Group name information. Notice that the CDS name field changes to ACTIVE
automatically.

Copyright IBM Corporation, 2007

Page 20 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__6. Look at the volume with the serial number (name) DMPU03 by entering DMPU03 in the
Volume Serial Number field. Use F10 and F11 to scroll left and right on the panel that
shows the details for DMPU03.
__7. Answer this question (#1) in your DFSMS member: What is the physical address (Device
Number) of this volume? (Hint: Look at column 13 Dev Num)
__8. Now go back to the VOLUME SELECTION ENTRY PANEL. Find all volumes that start with
DMP (DMP*) that are in the 071C-0725 address range.

Another Challenge: Answer the following questions:


questions:
__1. In your DFSMS member: How many volumes are there?
__2. Now, through ISPF Option 3.4, figure out which volume VITALITY.COBOL.JCLBKUP
resides on. Look this volume up in ISMF.
__3. In your DFSMS member: What storage group is VITALITY.COBOL.JCLBKUP in? (Hint:

Look up the volume this PDS is in and then look up the storage group for this volume
using ISMF)
__4. In your DFSMS member: What other volumes are in this storage group? (Hint: Enter the
Copyright IBM Corporation, 2007

Page 21 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

storage group through the volume selection panel and use a wild card for the volumes)
__5. In your DFSMS member: Are there any volumes in this storage group with less than 30%
capacity left? If so, which one(s)? (Hint: Enter the command VIEW 4 to look at the %
Free column only)
Once you answer all five questions above, you are capable of handling basic storage
management tasks that a systems programmer will regularly need to perform.
You have just completed another challenge! Congratulations.

(8.) Write your own ISPF panel


Background:
You can add a new icon to the desktop on your PC, and you can customize your environment in
z/OS as well. The panel interface of ISPF can be completely re-written to fit your needs. Most
mainframe shops do this as a first step of their customization. The DEMONET system already has a
degree of customization to its panels, as you may have noticed at the customized welcome screens.
Your Challenge:
Challenge: Add the SDSF option to your own customized ISPF panel.
__1. Exit ISPF (F3) to the TSO READY prompt and type ex
'VITALITY.ZOS.CONTEST.CLIST(BLANKPNL)'.
'VITALITY.ZOS.CONTEST.CLIST(BLANKPNL)' This will start a new, customized ISPF main
panel. This panel has been stripped down. There is just enough functionality there for you to
work on a new panel of your own design.
Option 4, Echo JCL, is a teaser for now. You won't be working with this option until the next
challenge.

Copyright IBM Corporation, 2007

Page 22 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Note: If at any time you need to get back to the original ISPF main panel, you can do so by entering
ex 'VITALITY.ZOS.CONTEST.CLIST(RESET)' from the TSO READY prompt. If there are still errors you
can issue LOGON DNET### from the TSO READY prompt to re-logon, which will revert any other
changes that may have created errors.
__2. In your normal ISPF session, enter the PANELID command on the command line: you'll see the
panel name appear in the upper left corner. As you go into other menus (like Option 3), you'll
see that the panel ID changes. Browse around and check out some panel IDs. You can find the
code for the slimmed-down ISPF and Utility panels in the data set
VITALITY.ZOS.CONTEST.PANELS. The panel IDs for the slimmed-down ISPF and Utility panels
correspond to member names in that data set.
__3. Take a look at VITALITY.ZOS.CONTEST.CLIST(BLANKPNL).

Copyright IBM Corporation, 2007

Page 23 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

You'll see a list of concatenated data sets. These are all of the data sets that hold other panels that
you might need while working in ISPF. Often in z/OS, data sets are concatenated so that they are
processed logically as one big data set. When two data sets have the same member name, the one
that is first in the concatenation takes precedence. You'll notice that in this CLIST (command list),
VITALITY.ZOS.CONTEST.PANELS is first in the list. It takes precedence over all the others. The
original ISPF panels are in CENTER.ISPPLIB, which is further down the list.
Here's what you need to do to complete this challenge:
__4. Copy the VITALITY.ZOS.CONTEST.PANELS data set into your own data set
(VITALITY.DNET###.PANELS) that you can modify.
Copying an entire data set with all its members is something you haven't done yet. Here's how you
do it:
__5. Find the Move/Copy Utility (ISRUMC1) from your ISPF main panel. Specify the copy option,
and then fill in the data set name you are copying.
__6. On the next panel, specify the data set name you are copying to. (Remember the rule about

single quotes when specifying data set names.)

Copyright IBM Corporation, 2007

Page 24 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__7. On the next panel (ISRUMCM1), put an "s" beside each member to specify that you want to
copy both of them. Verify that your new data set contains both members.
__8. Copy VITALITY.ZOS.CONTEST.CLIST(BLANKPNL) into your own data set
(VITALITY.DNET###.CLIST) that you can modify. (Throughout this contest, you can press

Enter to allow truncation if prompted to do so.)


__9. Add an option to your copy of .ZOS.CONTEST.PANELS to make SDSF an option from your
slimmed-down ISPF panel. Your new panel must tell the user what option to enter to open
SDSF -- "S" or "SD" are both common conventions, though you can make it something different
if you choose. SDSF must open correctly from your panel when the appropriate command ("S",
"SD" or whatever you choose) is entered. Need to borrow a line of code from the original ISPF
main panel to make your SDSF option work.
__10. Modify your copy of BLANKPNL so that your new panel takes precedence.
__11. Execute your new CLIST from the TSO READY prompt to display your customized panel.
If you did everything right, you should have an ISPF panel that looks something like this, with an
SDSF option that works.

Copyright IBM Corporation, 2007

Page 25 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

If youre not quite there, below is what your BLANKPNL should look like (substituting DNET823 for
your DNET### ID puts your panel in first priority)

Your DNET###.PANEL(ISR@PRIM) should look like the following:

Copyright IBM Corporation, 2007

Page 26 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

You just made your own version of ISPF. Congratulations on getting through a tougher challenge!!!

(9.) ISPF and REXX programming challenge


Background: In this challenge, you'll be working with the Echo JCL option on your slimmed-down
ISPF menu. By this point, you've seen and worked with JCL, REXX and ISPF panels. Now it's time to
write some code! Don't worry -- these instructions will help you through it.
Reminder: You must complete Challenges 3 and 8 correctly before attempting this challenge.
The type of work you'll be doing in this challenge is a common scenario in z/OS shops -- modifying
existing tools to help get your job done. As we've already discussed, JCL has been around for quite a
while, and just about everything a systems programmer could need has been written before. The
tool you're about to create is an example of automating a task to make life easier.
Your Challenge:
Challenge:
Create an Echo JCL panel that will submit a JCL job to run the
VITALITY.ZOS.CONTEST.REXX(RUNME) program. The panel must meet these specifications:
a. It must ask for two inputs:




A data set name (VITALITY.ZOS.CONTEST.REXX)


A member name (RUNME)

If either of the two input fields is left blank, a customized error message should pop up. It should
submit a customized JCL job that runs the REXX program (RUNME) and sends the output to SDSF.
__1. First, let's copy over all the files you're going to need from VITALITY.ZOS.CONTEST into your
VITALITY.DNET### data sets. You've already copied over this crucial member:
VITALITY.ZOS.CONTEST.PANELS(ECHOJCL).
__2. Also need to copy:

VITALITY.ZOS.CONTEST.MESSAGES(EJCL00). The error messages for the Echo JCL


panel are here.

VITALITY.ZOS.CONTEST.REXX(ECHOJCL). This is the REXX program that your Echo


JCL panel will run. This program creates a JCL file to submit the RUNME job.

Copyright IBM Corporation, 2007

Page 27 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

VITALITY.ZOS.CONTEST.SKELETON(ECHOJCL). The REXX program uses this


member for a JCL template.

VITALITYZOS.CONTEST.CLIST(ECHOJCL). Notice that it has the same library


concatenation as BLANKPNL, as well as two additional concatenation definitions.
SYSEXEC defines where the system looks for commands (like 'path' in Windows or
Linux). ISPMLIB (Interactive System Programming Message Library) defines where
to look for messages. In the ISPPLIB concatenation, make the same change you made
in Challenge 8 so that your panels are given precedence ahead of
VITALITY.ZOS.CONTEST.PANELS.

Now let's take a moment to step through Echo JCL as it works right now:
__3. F3 out to the TSO READY prompt and run this command:
ex 'VITALITY.DNET###.CLIST(ECHOJCL)'
'VITALITY.DNET###.CLIST(ECHOJCL)'
__4. Choose the Echo JCL option from your slimmed-down menu.
__5. Press Ctrl when the String field is blank. You get a "Please Enter a String" message. Messages
like this one are easily defined in the panel code -- we'll play with messages shortly!

__6. Now enter a string into the field and press Ctrl. Once you enter a string, a job is automatically
submitted.

Copyright IBM Corporation, 2007

Page 28 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__7. Let's view the output in SDSF. Your job has been sent to your held output queue with a
jobname of EJCLT###. The output for SYSUT2 is the string you just typed in. Sort of like a JCL
echo!
Now we're going to modify Echo JCL to create an application that will run a REXX exec using JCL,
conforming to the specifications given above.
In your fixed version of VITALITY.DNET###.JCL(BADJCL), make the following customizations:
__8. On this statement:
//DBJB### JOB 'BROKEN JCL JOB',MSGLEVEL=(1,1),
Replace DBJB### with RJCLT###, where ### is the last three digits in your user ID.
__9. On this statement:
//SYSEXEC DD DSN=VITALITY.ZOS.CONTEST.REXX,DISP=SHR
Replace VITALITY.ZOS.CONTEST.REXX with VITALITY.DNET###.REXX
__10. Replace %RUNME with %ECHOJCL
Now we need to customize each of the files that you copied earlier. Let's step through each of them:
__11. In your copy of CLIST(ECHOJCL), you need to update the SYSEXEC and ISPMLIB
concatenations. Update each of these so that your panel will look in your data sets first, instead
of the VITALITY.ZOS.CONTEST data sets.
__12. In your copy of MESSAGES(EJCL00), create two new messages named EJCL002 and
EJCL003. The second line is a more detailed message explanation -- you can leave this line the
same for each message.




EJCL002 should say: "Yo! Please input a data set name."


EJCL003 should say: "Hey! How about a member name?"

If you'd like to see more information on defining messages, check out Chapter 9 of Dialog
Developer's Guide and Reference.
__13. In your copy of PANELS(ECHOJCL), you need to modify the panel to accept two inputs. The
original panel has an input for a field called STRING. Change the first input field to accept a
data set by changing the STRING label to STRING1.

Copyright IBM Corporation, 2007

Page 29 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__14. Add another field directly underneath called STRING2. Down in the panel code below, you
need to make a few more changes:
__15. Copy and repeat both lines of the IF statement.
__16. Make the first IF statement refer to STRING1 and EJCL002.
__17. Make the second IF statement refer to STRING2 and EJCL003.
__18. Send both STRING1 and STRING2 parameters to ECHOJCL.

If you'd like to see more information on editing panels, see Chapters 6 - 8 of Dialog Developer's
Guide and Reference.
In your copy of REXX(ECHOJCL), you need to make a few changes so that the REXX is expecting two
parameters. The comments in that file should help you along. There are three things you need to
change:
__19. Parse two arguments instead of one.
__20. Store those arguments in two strings instead of one. The variable names aren't important,
but they should reflect the values they hold and be meaningful to the programmer.
__21. In the code below, point to your skeleton member rather than the contest skeleton member.

To learn more about coding in REXX, refer to z/OS TSO/E REXX Reference.
__22. In your copy of SKELETON(ECHOJCL), overwrite all of the JCL with the JCL in your
DNET###.JCL(BADJCL).
Now there are three changes you need to make:
__23. &SYSUID needs another & in front (this is explained in the comments of
SKELETON(ECHOJCL))
__24. The SYSEXEC line needs a change. Replace the data set name with &variable_name, where
variable_name is the name you assigned in the REXX program to accept the data set name.
Copyright IBM Corporation, 2007

Page 30 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__25. %ECHOJCL needs to be replaced with %&variable_name2, where variable_name2 is the


name you assigned in the REXX program to accept the member name.

Additional resources about file tailoring (using JCL skeleton files), or how exactly to customize your
SKELETON(ECHOJCL) file, then please review Chapter 10 of Dialog Developer's Guide and
Reference.
__26. You just made a lot of changes! Now your Echo JCL panel should work. To view the changes
made, press F3 out to the TSO prompt and run this command:
ex 'VITALITY.DNET###.CLIST(ECHOJCL)'
__27. After this, type in ZOS.CONTEST.REXX and RUNME in the two fields on your panel and get
the same output that you got from your fixed JCL.
You have successfully written your first z/OS tool! Congratulations!!!
Time to move on to the next challenge. You'll probably want to restore and use the regular ISPF
panels from this point on.
__28. After copying over the necessary datasets, give precedence to your panels by changing
VITALITY.ZOS.CONTEST to VITALITY.DNET###....... As shown in the following
screenshots.

Copyright IBM Corporation, 2007

Page 31 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__29. To view the output of your Echo JCL job in SDSF, its best to use the screen splitting feature
mentioned by pressing F2.
__30. Go into SDSF. Type ST for the Status of jobs.
__31. On the Command Line, type PRE EJCLT###, substituting ### as normal. This sets the
prefix to the program you just ran. If you scroll down to the bottom of the SDSF output for
your program, you should see the line of text that you entered on the String line. In the
following case I entered blah.

Copyright IBM Corporation, 2007

Page 32 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

In the next step, after making the necessary changes to your JCL(BADJCL) member, it should look
similar to this:

Your edited version of CLIST(ECHOJCL) should also look similar to the following:

Copyright IBM Corporation, 2007

Page 33 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

After editing your MESSAGES(EJCL00) member, it should look similar to the following:

After editing your PANELS(ECHOJCL) member, it should look similar to the following:

Copyright IBM Corporation, 2007

Page 34 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

Copyright IBM Corporation, 2007

June, 2007

Page 35 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

And your member of SKELETON(ECHOJCL) should look similar to the following:

After making all the necessary changes and running your panel from the TSO prompt, you should
fill in the two lines as shown below. There should be now JCL error when you run it.

Copyright IBM Corporation, 2007

Page 36 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

(10.) Trickier JCL error


Background: Have a look at VITALITY.ZOS.CONTEST.JCL(BADJCL2). It doesn't run as is. There is an
error in the JCL. Luckily, fixing JCL errors is your specialty!
Your Challenge:
Challenge:
__1. Save this member in your VITALITY.DNETXXX.JCL dataset.
__2. Track down the error, fix it and use SDSF to save all of the correct output to a member named
LASTJOB in your COMPETE.PARTTWO data set (VITALITY.DNETXXX.COMPETE.PARTTWO).
__3. Be sure to change jobname to BAD### (where ### is the last three digits in your ID).

Copyright IBM Corporation, 2007

Page 37 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

When it runs correctly, this job lists information about modules. If you are interested in application
programming, you might want to look into what this AMBLIST job does. If you get stuck, start going
through the JOB Card parameters one by one to see if you can figure out what each one of them
means.

Hint:
Hint: Initiators are address spaces where batch jobs run, instead of the jobs running in your address
space. For a job to execute, it needs an eligible initiator. Take a look at the INIT option in SDSF to
find out more about the initiators on the system.
Good luck!

(11.) Compile Assembler, COBOL, PL1 and C using JCL


Background:
As an application programmer on z/OS, it's important to know how to edit your programs and
also how to compile and run them. You've done enough work in the ISPF editor to know how to
edit your programs, so let's take a look at compiling and running.
Your Challenge:
Challenge:
In this challenge you are going to compile and run customized Assembler, COBOL, PL/I and C
programs. Let's start with the C program!
__1. Copy VITALITY.ZOS.CONTEST.SRC(CSRC) to your SOURCE data set
VITALITY.DNETXXX.SRC(CSRC).
__2. Copy VITALITY.ZOS.CONTEST.JCL(CRUN) to your JCL data set
(VITALITY.DNETXXX.JCL(CRUN). Change jobname to CRUN####.
__3. Submit your CRUN job. The output is similar to the previous three examples. There is a new
member in your OUTPUT data set called CRUN.
__4. Change this program to count to 1000, and change "My" in your output to "YourName's".
__5. This one was too easy, wasn't it? When you have a working program, save your SDSF
Copyright IBM Corporation, 2007

Page 38 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

output to CRUN in your COMPETE.PARTTWO data set.


Now lets compile and run your Assembler program:

HINT: Complete the C program before the assembler program. Refer to the Answers Section to
confirm your solution for C.
__1. Copy the assembler source code from VITALITY.ZOS.CONTEST.SRC(ASMSRC) into
VITALITY.DNETXXX.SRC(ASMSRC).
__2. Copy the ASMRUN member from VITALITY.ZOS.CONTEST.JCL(ASMRUN) into your JCL
data set VITALITY.DNETXXX.JCL(ASMRUN).
__3. Take a look inside. There are three different steps: Compile, Link, and Run.
Let's customize this JCL for you to run it.
__4. Change jobname to ASMR### (where ### is the last four digits in your user ID). Change
the SYSIN card of the compile step to point to your SOURCE data set. Change the rest of the
references to your_id to match your user ID.
__5. Submit the job and take a look at the output.

Copyright IBM Corporation, 2007

Page 39 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

If it ran successfully, you should see the screen below:

__6. Lets go to SDSF to look at the output. Enter ? next to your jobname (ASMRUNXXX) and
press Ctrl

__7. Look at the PRTLINE RUNPGM to see the output Look familiar? It's the same output as the C
program, plus a few leading 0's.

Copyright IBM Corporation, 2007

Page 40 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__8. The program counts from 1 to 10. Now take a look in your OUTPUT data set . There is a
new a member called ASMRUN that should say "My first z/OS assembler program."

__9. In your copy of the code, make the program count from 1 to 1000. In the ASMRUN output
piece, have your program change "My first z/OS program" to "YourName" first z/OS
assembler program". Because you are putting a quote within quotes, you'll need to put the
single quote twice in YourName.

Copyright IBM Corporation, 2007

Page 41 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__10. Save your changes and run the program.


The program should now count to 1000. The first and last pages of your PRTLINE RUNPGM
output should look like the screen shots below:

Copyright IBM Corporation, 2007

Page 42 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__11. When you have a working program with modifications, save your SDSF output to
ASMRUN in your COMPETE.PARTTWO data set (remember XDC from Challenge 2?).
Got it to work? Great job! Now let's try it with COBOL:
__1. Copy VITALITY.ZOS.CONTEST.SRC (COBSRC) into your VITALITY.DNETXXX.SRC(COBSRC)
data set.
__2. Copy VITALITY.ZOS.CONTEST.JCL(COBRUN) into your JCL data set
VITALITY.DNETXXX.JCL(COBRUN).
Take a look. Notice the &SYSUID symbols in a few of the DD cards. That is a reference to a system
symbol of your user ID (remember that from Challenge 9?) With these symbols in place, you no
longer need to change your_id to your user ID. But you still need to change jobname to
COBR### (where ### is the last four digits in your user ID).

Copyright IBM Corporation, 2007

Page 43 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__3. You should now be able to run the job. Run it and check your output.
If it runs successfully you should see the screen below:

__4. Lets go to SDSF to look at the output. Enter? next to your jobname (COBRUNXXX) and
press Ctrl.

Copyright IBM Corporation, 2007

Page 44 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

The output is similar to previous two examples:

In your OUTPUT data set there is a new member called COBRUN, which also has the same
output, along with a timestamp.

Copyright IBM Corporation, 2007

Page 45 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__5. Do the same trick of changing the program to count to 1000. Change "My" to "YourName's"
in the generated output member.

__6. Run the program.


Check the results to make sure they match with the previous two.

Copyright IBM Corporation, 2007

Page 46 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__7. When you have a working program, save your SDSF output to COBRUN in your
COMPETE.PARTTWO data set.
One more to go and Part 2 is complete! Let's crank out PL/I (Programming Language One), a
feature-rich programming language:
__1. Copy VITALITY.ZOS.CONTEST.SRC(PLISRC) to your SRC dataset.
Copyright IBM Corporation, 2007

Page 47 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__2. Copy VITALITY.ZOS.CONTEST.JCL(PLIRUN) to your JCL dataset.


__3. Change jobname to PLIR###.
__4. Submit your PLIRUN job. The output is similar to the previous examples, and there is a new
member in your OUTPUT dataset called PLIRUN. You'll notice the text in your new member in
your OUTPUT data set contains some extra text: "time not set yet...".
__5. Edit your PLISRC member to uncomment the 5 lines of code that will save the time the
program was compiled. Now when your program runs, it should print both the time it was
compiled and the time it ran.
__6. Try resubmitting the JCL.
The compile step now has an error with a return code of 8, right? There's a JCL compiler option that
you need to specify for the timestamp to work. Let's find that compiler option!
Where to look? Try the z/OS Library Center, the primary source for everything you'd ever want to
know about the mainframe. (Note: The Library Center uses scripting that runs faster in Internet
Explorer than Firefox.)
__7. On the left-hand navigation panel, expand the entry for "z/OS software products (D-I)".
__8. Scroll down to "Enterprise PL/I for z/OS and OS/390 V3R2 Language Reference." Expand this
entry so that you can see the contents of the document.
__9. Click on "9.0 Chapter 9. Statements and directives."
__10. In the right-hand frame, click on the link for "Preprocessor facilities in topic 21.0."
__11. The first paragraph describes a preprocessor facility that you need to make your program
run correctly. Insert this preprocessor facility as the fourth argument to the PARM statement
in your PLIRUN JCL job.
__12. Once you've fixed your JCL, submit the job to run again. Your OUTPUT data set member
should now display both the time the program was compiled and the time it ran!

Copyright IBM Corporation, 2007

Page 48 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

__13. Now, like in the previous programs, change this program to count to 1000 and change "My"
to "YourName's" in the generated output member.

You have just completed all of the required work for Part 2! You are truly a Master of the
Mainframe!!!

(12.) What's next?


Congratulations! You have successfully completed Part 1 and 2 of this exercise. You have really
demonstrated some significant mainframe skills to get this far!!
If you are interested in getting involved on a much deeper level with the workings of the z/OS
mainframe system you should look at Part 3: Real-World Challenge of this exercise. This part will
expose you to tackling issues that occur in realreal-world IT shops. Part 3 is set up as a series of
increasingly difficult challenges and it is targeted to people who are very serious about putting in
many of hours on the mainframe over the next few months. There are two sets of tasks in the Part 3
exercises. The first set targets System Programmers and the second set targets Application
Developers, CICS and DB2 Administrators.
To give you a sneak peek of what the Part 3 challenges entail, a very brief description of each is
included below.
The first set of tasks targeting System Programmers include challenges such
such as:
1. Running commands from TSO
2. Compiling, debugging and writing COBOL programs
3. Compiling CICS (Customer Information Control System) 3270 Screen Map
4. Compiling CICS COBOL programs
5. Creating VSAM (Virtual Storage Access Method) data set with VSAM Alternate Index
6. Defining 3270 Screen Map, programs and VSAM files to CICS
7. Modifying procedures to include user load module library
8. Starting CICS
9. Testing a CICS application
10. Creating and loading a DB2 database
Copyright IBM Corporation, 2007

Page 49 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

11. Compiling COBOL source code which includes DB2 SQL statements
12. Running COBOL programs within the DB2 environment
13. Compiling and executing JAVA code with DB2 SQL statements
The second set of tasks targeting Application Developers, CICS & DB2 Administrators include
challenges such as:
1. Download Z.CONTEST data set to workstation
2. IBM manuals and documentation
3. Define personal z/OS usercatalog, alias and userid
4. System commands and the SYSLOG
5. SYSLOG review and system initialization
6. Using ftp to enter system commands and JCL
7. Using ftp to download SYSLOG to workstation
8. Java (find it, change env variables, compile & execute)
9. ISRDDN and CLIST
10. HTTP Server (start and modify front page)
11. CICS (start, logon and shutdown)
12. DB2 (start, and use)
13. I/O Configuration (Disk and Network)
14. z/OS Assembler (compile, execute and modify)
15. System parameter inconsistencies
16. TSO access problem
17. JES initiator problem
18. CICS-DB2 Connectivity
If you are interested in this part of the exercise contact Paul Newton for additional information.
Good Luck!!!

Copyright IBM Corporation, 2007

Page 50 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

SOLUTIONS TO EXERCISES

Copyright IBM Corporation, 2007

Page 51 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

(7.1.) Answers to Questions in Section (7.)


1. The Device Number (physical address) for the volume serial DMPU03 is 071E

2. There are 10 volumes with volume serial # DMP* and are in the 071C-0725 address range

Copyright IBM Corporation, 2007

Page 52 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

3. VITALITY.COBOL.JCLBKUP is in the storage group USRGROUP (and in the volume DMPU30)

Copyright IBM Corporation, 2007

Page 53 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

4. 30 Volumes altogether in the storage group USRGROUP (DMPU01-DMPU30)

5. All 30 volumes (DMPU01 DMPU30) have less than 30% capacity left.

Copyright IBM Corporation, 2007

Page 54 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Your member DFSMS should look like this:

(10.1) Answers to Questions in Section (10.) Trickier JCL error


1. To make a copy of the VITALITY.ZOS.CONTEST.JCL(BADJCL2) in your JCL dataset, open
VITALITY.ZOS.CONTEST.JCL(BADJCL2).
2. Edit line number 00010 to read C9999.
3. On the command line enter CREATE VITALITY.DNETXXX.JCL(BADJCL2) and press the Ctrl
key:

Copyright IBM Corporation, 2007

Page 55 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

You will see the message Member BADJCL2 created.


4. Open VITALITY.DNETXXX.JCL(BADJCL2) and look at the JCL:

5. Change the jobname to BADXXX. Run this batch job by entering SUBMIT on the command line:

Copyright IBM Corporation, 2007

Page 56 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

6. Go to SDSF to look at your output. You will see that a JCL error was returned!
A little background:
background Initiators are address spaces where batch jobs run. These initiators have IDs
assigned to them and job classes assigned to each initiator.
7. To see the initiators defined in the DEMOMVS system, go to SDSF and enter INIT on the
command line:

Copyright IBM Corporation, 2007

Page 57 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

8. You will see the IDs and Classes of the initiators defined for the system. The JCL, BADJCL2, has a
class of 1. You can see that this is an issue since no class 1 is defined for any of the initiators!
Recall, for a job to execute, it needs an eligible initiator. Class A is defined, so go ahead and
change the class to A in your JCL:

9. Now resubmit the job. You should see the screen below to show that the job ran correctly with
Code 0:

Copyright IBM Corporation, 2007

Page 58 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

10. Go to SDSF to look at your output. Now you need to save all of the output to a member named
LASTJOB in your COMPETE.PARTTWO data set (VITALITY.DNETXXX.COMPETE.PARTTWO).
First of all, create this member. Next, enter XDC on the NP column next to your jobname
(BADXXX) output and press Ctrl.

11. From the XDC menu, correctly specify the target data set name
(VITALITY.DNETXXX.COMPETE.PARTTWO), target member (LASTJOB) to use and disposition
(OLD). You can accept all the other defaults and press Ctrl.

Copyright IBM Corporation, 2007

Page 59 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Now you'll find a new member in your COMPETE.PARTTWO data set. Go have a look.

(11.1) Answers to Questions in Section (11.) Compiling Programs

Compiling C Program using JCL:


1. Copy VITALITY.ZOS.CONTEST.SRC(CSRC) to your SOURCE data set
VITALITY.DNETXXX.SRC(CSRC) and copy VITALITY.ZOS.CONTEST.JCL(CRUN) to your JCL data
set (VITALITY.DNETXXX.JCL(CRUN) - review Part One for tips on how to do this.
2. Open your CRUN member and change the jobname to CRUN### (where ### is the last three
digits of your DEMONET ID)

Copyright IBM Corporation, 2007

Page 60 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Look at the JCL- you can see that it is doing a compile, link (bind) and run of the program. Basically,
the compiler takes C code and turns it into assembler code which gets assembled into machine
code. However, that machine code usually makes reference to system modules (pieces of code
maintained by the system) so the linker resolves references to external library code such as that and
stores the output as an executable file to run it you just load the executable file into an address
space and off you go! Notice also that the Step 2 Program COUT will not run unless the bind code
completes with a return code of 0. Enough said!
3. You can also see that two data sets are defined- VITALITY.DNET###.LOADLIB and
VITALITY.DNET###.OUTPUT, that have not been created. Lets create them now.
4. Allocate the *.OUTPUT data set with the following parameters: Mgmt class, Storage Class, Vol

Ser = blank; RECFM=FB; LRECL=80; BLKSIZE=3200; Data Set Name Type= LIBRARY; take defaults
for everything else).
5. Allocate the *.LOADLIB data set with the following parameters: Mgmt class, Storage Class, Vol

Ser = blank ; Record format=U; Record length= 0; Block Size= 32760; 1st extent blocks= 26;
Secondary blocks=100; Data Set Name Type= PDS; take defaults for everything else)

Copyright IBM Corporation, 2007

Page 61 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

You will get the message Data Set Allocated on the top right corner of the screen.
6. Lets allocate VITALITY.DNETXXX.OUTPUT:

Copyright IBM Corporation, 2007

Page 62 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

You should see the message, Data Set Allocated on the top right corner of the screen.
Now we are ready to submit your CRUNXXX job. Lets do that:

Copyright IBM Corporation, 2007

Page 63 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

If it runs successfully you should see the screen below:

7. Lets go to SDSF to look at the output. Enter ? next to your jobname (CRUNXXX) and press
Ctrl.

Copyright IBM Corporation, 2007

Page 64 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

8. Look at the SYSPRINT Step 2 to see that the program counted from 1 10:

Copyright IBM Corporation, 2007

Page 65 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

9. Now lets go and look at the new member CRUN created in your OUTPUT data set.

10. Now lets go and change the source C program to count to 1000 instead of 10, and change
"My" in your output CRUN to "YourName's". Open VITALITY.DNETXXX.SRC(CSRC) and

Copyright IBM Corporation, 2007

Page 66 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

make the changes shown in the screen shot below:

11. F3 out to save your changes.


12. Now lets resubmit your CRUNXXX job again and go to SDSF to look at your SYSPRINT Step
2 output.
You should get this screen if your job ran correctly:

Copyright IBM Corporation, 2007

Page 67 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

The program should now count to 1000. The first and last pages of your SYSPRINT Step2 output
should look like the screen shots below:

Copyright IBM Corporation, 2007

Page 68 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Nows let go and see what your CRUN member should look like. Notice the change from My to
Oges.

Now save your SDSF SYSPRINT Step 2 output to your CRUN member in your

Copyright IBM Corporation, 2007

Page 69 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

COMPETE.PARTTWO dataset. Create this member CRUN in your COMPETE.PARTTWO dataset.


Then enter XDC in the NP column of the SYSPRINT Step 2 output of your CRUNXXX job to print
the output to your CRUN member:

Copyright IBM Corporation, 2007

Page 70 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

13. From the XDC menu, correctly specify the target data set name
(VITALITY.DNETXXX.COMPETE.PARTTWO), target member (CRUN) to use and disposition
(OLD). You can accept all the other defaults and press Ctrl. The output should now be saved
to your CRUN member.

Compiling PL/I Program using JCL:


1. In step 4, when you look at the PLIRUN member in OUTPUT, it should look something like this:

After step 5, your PLISRC should reflect the changes made here:

Copyright IBM Corporation, 2007

Page 71 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

In case you had trouble reading the document linked in step 7, or you just need a hint, the missing
parameter in the PARM statement of the PLIRUN JCL is MACRO. Once you insert it as below, you
should get the proper output, shown 2 pictures down.

Copyright IBM Corporation, 2007

Page 72 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

Correct output file:

2. In order that your program outputs Your Names instead of My, change the
PRTDONE_COMMENT so it looks like the following. Note that the line is too long and must be
carried to the next line.

3. To get it to count to 1000, change the do loop from DO I=1 to 10 to DO I=1 to 1000.

Copyright IBM Corporation, 2007

Page 73 of 75

Mainframe Hands On Exercises 4 IBMers- Part Two

June, 2007

4. After submitting, you should notice the job takes longer to run and the output file should have
changed as below:

Copyright IBM Corporation, 2007

Page 74 of 75

You might also like