Вы находитесь на странице: 1из 134

Business

Intelligence

Data
Centre

Cloud

Mobility

Enterprise Computing Solutions

Student Manual

Direccin General de Formacin


CONSEJERA DE EMPLEO,
TURISMO Y CULTURA

Comunidad de Madrid

UNIN EUROPEA
FONDO SOCIAL EUROPEO
El Fondo Social Europeo invierte en tu futuro

EDUCATION
S

V8.0

cover

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Front cover

Fundamental System Skills


in z/OS
(Course code ES10)

Student Exercises

pr

Ex

cl

ERC 11.0

Student Exercises

Trademarks
IBM is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX
CICS
ESCON
HiperSockets
MVS
Parallel Sysplex
PR/SM

BookManager
DataPower
eServer
IMS
Open Class
Power
RACF

RMF

S/390

System x
System z9
WebSphere
z/VM
zSeries

System z
System/390
z/Architecture
z/VSE
z10

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

AIX/ESA
C/370
DB2
FICON
Language Environment
OS/390
POWER7
Resource Measurement
Facility
SecureWay
System z10
VTAM
z/OS
zEnterprise
z9

Adobe is either a registered trademark or a trademark of Adobe Systems Incorporated in


the United States, and/or other countries.
Pentium is a trademark or registered trademark of Intel Corporation or its subsidiaries in
the United States and other countries.

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or
both.

Windows is a trademark of Microsoft Corporation in the United States, other countries, or


both.

cl

UNIX is a registered trademark of The Open Group in the United States and other
countries.

Ex

Java and all Java-based trademarks and logos are trademarks or registered trademarks of
Oracle and/or its affiliates.

pr

June 2013 edition

The information contained in this document has not been submitted to any formal IBM test and is distributed on an as is basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customers ability to evaluate and integrate them into the customers operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

Copyright International Business Machines Corporation 2001, 2013.


This document may not be reproduced in whole or in part without the prior written permission of IBM.
Note to U.S. Government Users Documentation related to restricted rights Use, duplication or disclosure is subject to restrictions
set forth in GSA ADP Schedule Contract with IBM Corp.

Student Exercises

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Other product and service names might be trademarks of IBM or other companies.

iii

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

iv

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Exercises description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Lab environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

Exercise 1. System familiarization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1


Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Exercise 2. Allocate new data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 1: Allocate a physical sequential (PS) data set . . . . . . . . . . . . . . . . . . . . . . . .
Part 2: Allocate a partitioned data set (PDS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 3: Allocate a partitioned data set extended (PDS/E) . . . . . . . . . . . . . . . . . . .

2-1
2-2
2-2
2-2
2-2

Exercise 3. ISPF editor primary commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1


Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Exercise 4. ISPF editor line command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Part 1: ISPF editor line commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Exercise 5. Copy/move/rename/delete data sets and members . . . . . . . . . . . . . . . 5-1
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Exercise 6. Data set lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 1: Data set lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 2: UNIX directory list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6-1
6-2
6-2
6-3

cl

Exercise 7. Using TSO/E commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1


Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Part 1: TSO commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2

Ex

TOC

pr

Exercise 8. Submit a job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1


Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Part 1: LAB: Submit a job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
Exercise 9. JCL exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 1: Copy selected member of PDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 2: Copy an entire data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 3: Copy/replace a selected member . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 4: Perform a secure compress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

Contents

9-1
9-2
9-2
9-2
9-3
9-3

Student Exercises

9-3
9-4
9-6
9-6
9-6
9-6
9-7
9-7

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Part 5: Compress a data set inplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Part 6: Copy a PDS and a PDSE data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Optional exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 1: Copy instream data to PS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 2: Copy a sequential data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 3: Print a sequential data set to SYSOUT . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 4: Print a PDS member . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Part 5: Create a PDS member . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Exercise 10. Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-1


Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Part 1: Override DD-statements of an in-stream procedure . . . . . . . . . . . . . . . . 10-2
Part 2: Run cataloged procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
Part 3: Create cataloged procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
Part 4: Use of DFSORT (ICEMAN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
Optional exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
Part 1: Create PS from in-stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
Part 2: Conditional processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
Part 3: Route a Job to INTRDR using IEBGENER . . . . . . . . . . . . . . . . . . . . . . . 10-7
Exercise 11. ISHELL and hierarchical file system . . . . . . . . . . . . . . . . . . . . . . . . . .11-1
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Part 1: ISHELL introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Part 2: Introduction to the file system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2
Part 3: Customize ISHELL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3
Part 1: Create a hierarchical file system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Part 2: Step 2 (Managing files) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5
Optional exercises: Part 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8
Part 1: Introduction to the file system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8
Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions . . . . . . . . . . . . . . A-1

pr

Ex

cl

Appendix B. JCL: Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1

vi

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM is a registered trademark of International Business Machines Corporation.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX/ESA
C/370
DB2
FICON
Language Environment
OS/390
POWER7
Resource Measurement
Facility
SecureWay
System z10
VTAM
z/OS
zEnterprise
z9

AIX
CICS
ESCON
HiperSockets
MVS
Parallel Sysplex
PR/SM

BookManager
DataPower
eServer
IMS
Open Class
Power
RACF

RMF

S/390

System x
System z9
WebSphere
z/VM
zSeries

System z
System/390
z/Architecture
z/VSE
z10

Adobe is either a registered trademark or a trademark of Adobe Systems Incorporated in


the United States, and/or other countries.
Pentium is a trademark or registered trademark of Intel Corporation or its subsidiaries in
the United States and other countries.

cl

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or
both.

Windows is a trademark of Microsoft Corporation in the United States, other countries, or


both.

Ex

TMK

UNIX is a registered trademark of The Open Group in the United States and other
countries.

pr

Java and all Java-based trademarks and logos are trademarks or registered trademarks of
Oracle and/or its affiliates.

Other product and service names might be trademarks of IBM or other companies.

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

Trademarks

vii

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

viii

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Exercises description
These exercises require access to a z/OS system that supports TSO/E
and ISPF. The student user IDs need the authority to:
Create data sets whose names start with the user ID

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Submit batch jobs

- On the ESSMVS1 system, these data sets have names starting


with D80WW.ES10V11.

The number of user IDs required depends on the number of students


or teams.
Each exercise in this course is divided into sections as described
below.

Exercise Instructions This section contains what it is you are to


accomplish. There are guidelines on how to perform the tasks. You are
given the opportunity to work through the exercise given what you
learned in the unit presentation, using the unit Student Notebook, your
past experience, and maybe a little intuition.

cl

Optional Exercise This section gives you additional exercises to


perform relating to the unit of discussion. It is strictly optional and
should be performed when you have completed the required
exercises. This section might help round out the hands-on experience
for a related unit.

Two versions of these instructions are available: one with hints and
one without. You can use either version to complete this exercise (or
flip back and forth between the two versions). In other words, use
these two versions of the exercise in whatever way best aids your
learning. Also, please do not hesitate to ask the instructor if you have
questions.

All hints are marked by a sign. In some cases, the answers given in
hints are examples only, and in other cases, answers are correct
answers.

pr

Ex

pref

Copyright IBM Corp. 2001, 2013

Exercises description

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

ix

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Lab environment

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

These labs are installed on the ESSMVS1 system in Montpellier


(France). To access them, a country must acquire user IDs appropriate
for the course. For more information on connectivity, and on
scheduling systems, please contact Lloyd Cox or Herv Bousquet.
The interactive exercises for ES10 are designed for and supported by
the z/OS system installed in Montpelier France.
Currently, the programming systems installed are:
z/OS - Version 1, Release 13.
ISPF/PDF - Version 6, Release 3.

TSO/E LOGON Command and LOGON EXECs:

The Instructor/Developer and Student TSO User IDs are defined to


invoke ES10 EXEC when the user signs on to TSO. The syntax of the
LOGON Command is:
%C12 ES10

The purpose of this exec is to allocate all the students data sets, at
time of the first logon.
This edition of course notes supports the following systems:
WW Learning Services ESSMVS1 system

cl

The technique used in the exercises is to use the tools taught in the
preceding lecture session to build the work you wish to perform. This is
the same technique you use back at work, where you rarely build
anything from the start, but rather start by copying previous work.

You gain most from this course by the effort you put into the exercises.
The aim should not be to get the exercises right in the minimum time.
Rather, as your aim is to learn, you should experiment and try new
ideas. Surprisingly, you learn more if you make a few mistakes. If in
doubt, try it out. Also, use the manuals and online documentation, ask
other students, and ask your instructor as often as practical.
Do not worry it you cannot finish all of the exercises during the lab
period. Some exercises are marked as optional to emphasize this
point. The goal of each exercise is to prompt you to think through the
problem, and to apply the concepts you have learned. The instructor
covers solutions during the lab reviews, and you also have a set of
solutions in your Exercise Guide.

pr

Ex

pref

While you are doing the exercises, let your imagination be your guide.
If you have completed the required exercise, look for ways to go
Copyright IBM Corp. 2001, 2013
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

Lab environment

xi

Student Exercises

beyond the problem statement and add your own enhancements to


the programs.

Solutions

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

We do not regard it as cheating to look at the solutions. Try to do the


exercises without looking at the solutions, but there is no point wasting
time. If you get stuck, ask a classmate, ask the instructor, or look at the
solutions.
Remember that the solutions are not perfect. They are just one way to
do the exercise, and pertain to the knowledge level of the part of the
course the exercise is presented. In some cases, the same exercise is
done at different stages in the course with different solutions. We do
this to illustrate the advantages of different techniques.
You find the solutions in the data set:
D80WW.ES10V11.SOLUTION.

TSO user IDs for the course

In the first exercise, you log on to the TSO user ID supplied for this
course. One user ID has been supplied for each student. Some
students find it best to work in teams, and some prefer to work
individually. This is entirely up to you. You are welcome to change
throughout the course.
There are currently ten sets of TSO IDs for production delivery:
TSOFS00-24, TSOFS50-74, and TSOFS75-99,
TSOFR00-24, and TSOFR25-49

TSOFT00-24, TSOFT25-49, TSOFT50-74, and TSOFT75-99.

For the IBM learning systems, the usual RACF rules apply, and you
have to change the password before you can log on. Note your new
password (and if working in a team, tell all the members of the team).
Your instructor has RACF authority to alter your password if you forget
it, and to resume your user ID if you exceed the password retry limit.
The password you create has to conform to the IBM internal rules, of

pr

Ex

cl

Passwords for production student IDs are initialized prior to class


using the standard PW assignment B4cccc4B, where cccc is the
4-digit class number.

xii

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

which GOOD1DAY is an example. Note the integer, which is neither the


first nor the last character.

pref

__________ on the ESSMVS1 system The instructor provides the


password. Do not change the password, unless the instructor
directs you to change it.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Procedure for logging onto TSO

The exact procedure that you have to use varies with the location
where the course is being held. Your instructor shows you how to
navigate the IBM network to access the appropriate system. The
actual logon procedure is very standard.

Initial logon procedure (ESS system)

Your instructor tells you how to access the TSO system. Your
terminals probably have access to hundreds to TSO systems, so one
of the errors you might make is to attempt to log on to the wrong
system. As all IBM systems are RACF-protected, there is no danger of
logging onto the wrong system.

Accessing TSO:

To do exercise work, you must turn on your training PC connecting you


to IBM's network.
Turn on the power switch to your computer and to your screen.
Wait for Windows to boot and ask you for your logon.

In the logon dialog, press the Windows-Enter-key without changing the


user's name or giving a password.

Make out the PCOM icon and double-click it. This opens up four
network sessions.
Choose one of the network sessions. This class normally runs on
ESSMVS1.

pr

Ex

cl

You should now see the indicated Desktop.

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

Lab environment

xiii

Student Exercises

Netid= USIBMES

IBM Training

Host = ESSCMC1

Terminal= SLIPA097

MOP CLPz

To Disc = LOGOFF

PAGE
06:49

APPLNAME STATUS

! APPLNAME STATUS

Wednesday - December 16, 2009


! APPLNAME STATUS

TSOE

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

-------------------------------------------------------------------------------UP

14:03

UP

12:26

ESSMVS1

UP

14:03

ESSMVS5

UP

16:51

MOPEDVM1

UP

12:36

MOPEDVM2

UP

12:26

ESSMVS7

UP

06:14

EDUCMVS

DOWN

13:44

A4OFS

DOWN

09:58

EDUCPLX1

UP

12:26

EDUCPLX2

UP

12:26

VM2

-------------------------------------------------------------------------------Help Desk (001)404-238-6000

INSTHELPUS.IBM.COM (888)502-5511(TL 888-6000)

IBM Mgt Approved Usage Only

==>

PF1=Help PF2=ESSMVS1 PF3=Return PF4=VM2

PF5=ESSMVS5 PF7=Backward PF8=Forward

Type in ESSMVS1 and press Enter or press PF2 to switch to


ESSMVS1.

The message IKJ56700A ENTER USERID - on your PCOM


Session confirms connectivity to ESSMVS1. Enter your TSO User ID
as prompted.

pr

Ex

cl

Next, you should see the TSO Logon screen. (the standard TSO logon
panel with fields on the right hand column). If not, you are probably on
the wrong system, or have entered the wrong user ID. You can correct
the user ID on this panel, if necessary. If you are on the wrong system,
you have to return to the initial logon panel (PF3).

When prompted with:


IKJ56700A ENTER USERID enter your TSO/E user ID, as given by your instructor (TSOSFnn).

You have to enter the administrator assigned password once and your
new password twice (for confirmation). Enter the password and press
xiv

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Enter (this might be the Ctrl or Enter key depending on the keyboard
mapping).

pref

If your password fails the IBM rules, TSO does not tell you until you
have entered all three items (old/new/new again). Make sure you do
not forget your new password.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Starting a TSO-ISPF/PDF Session.


------------------------------- TSO/E LOGON -----------------------------------

Enter LOGON parameters below:


Userid

===> TSOSF00

Password

===>

RACF LOGON parameters:

New Password ===>

Procedure ===> STUDENT

Group Ident

===>

Acct Nmbr ===> 1ES26G12


Size

===> 4096

Perform

===>

Command

===> %C12 ES26

Enter an 'S' before each option desired below:


-Nomail

cl

PF1/PF13 ==> Help

-Nonotice

PF3/PF15 ==> Logoff

-Reconnect

PA1 ==> Attention

-OIDcard

PA2 ==> Reshow

You now have access to the z/OS system being used for the
interactive exercises in ES10.
You might receive the following messages on your screen:

ICH70001I TSOSF00 LAST ACCESS AT 08:18:53 ON MONDAY, NOVEMBER 30, 2009


TSOSF00 LOGON IN PROGRESS AT 05:55:52 ON DECEMBER 16, 2009
*********************************************
***
THIS SYSTEM IS TO BE USED FOR
***
*** IBM MANAGEMENT APPROVED PURPOSES ONLY ***
*** USE IS SUBJECT TO AUDIT AT ANY TIME ***
***
BY IBM MANAGEMENT
***
*********************************************

pr

Ex

You may request specific help information by entering a '?' in any entry field.

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

Lab environment

xv

Student Exercises

You should see the ISPF Main Menu. If you see the READY prompt,
enter ISPF.

Password rules

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

IBM has installed a standard (to all IBM sites) RACF exit to enforce
additional password rules. The rules are:

Password must be at least eight characters in length


Password must contain at least one numeric character
Password must contain at least one alphabetic character
Password must not be numeric in the first or last position
Password must not contain four consecutive characters of your
current password
Password must not contain more than two consecutive repeating
characters
Password must not contain your user ID

Do not waste time here. If you have any difficulties, seek help from
your instructor or other students immediately.

pr

Ex

cl

Once you are into TSO, remember this rule: whenever you see three
red asterisks (***), all you can do is read the screen and press
Enter. Anything else you type is ignored.

xvi

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 1. System familiarization


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

The instructor uses this exercise to walk you through your first logon to
the lab system. You do a (very quick) tour of logging on to TSO,
starting ISPF PDF and setting some basic ISPF options.

What you should be able to do

At the end of the exercise, you should be able to:


Log on to your lab TSO user session
Start up the ISPF dialog

Requirements

pr

Ex

cl

This Exercise Guide

Copyright IBM Corp. 2001, 2013

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-1

Student Exercises

Exercise instructions

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

The instructor walks the class through the steps in the following visuals. Depending on
where this course is being administered, the way to display this screen and log on to the
classs lab system varies. The instructor will provide the specific information for your
environment.

The MOP CLPz menu

Netid= USIBMES
IBM Training
Terminal= SLIPA130
Host = ESSCMC1
MOP CLPz
PAGE 1
To Disc = LOGOFF
05:12 Tuesday - October 19, 2010
APPLNAME STATUS
! APPLNAME STATUS
! APPLNAME STATUS
-------------------------------------------------------------------------------TSOE
UP
06:39
!
!
VM2
UP
06:39
!
!
ESSMVS1
UP
06:39
!
!
ESSMVS5
DOWN 06:39
!
!
MOPEDVM1 UP
06:39
!
!
MOPEDVM2 UP
06:39
!
!
ESSMVS7
UP
06:39
!
!
EDUCMVS
DOWN 06:39
!
!
A4OFS
DOWN 06:39
!
!
EDUCPLX1 DOWN 06:39
!
!
EDUCPLX2 DOWN 06:39
!
!
!
!
!
!
!
!
-------------------------------------------------------------------------------Help Desk (001)404-238-6000 CLPHELPUS.IBM.COM (888)502-5511(TL 888-6000)
IBM Mgt Approved Usage Only
==>
PF1=Help PF2=ESSMVS1 PF3=Return PF4=VM2
PF5=ESSMVS5 PF7=Backward PF8=Forward

cl

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

Depending on where this course is being administered, the way to display this screen and
log on to the class's lab system varies. The way to get to this screen is:

Ex

_________________________________________________
_________________________________________________
_________________________________________________

pr

_________________________________________________
_________________________________________________

Access ESSMVS1 by pressing PF2 or entering ESSMVS1.


Your user ID is _______________________________
Your password is _____________________________
1-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

The logon screen


------------------------------- TSO/E LOGON -----------------------------------

Enter LOGON parameters below:


Userid

===> TSOFT98

Password

===>

RACF LOGON parameters:

New Password ===>

Procedure ===> STUDENT

Group Ident

===>

Acct Nmbr ===> 1ES10G12


Size

===> 4096

Perform

===>

Command

===> %C12 ES10

Enter an 'S' before each option desired below:


-Nomail
-Nonotice
-Reconnect

-OIDcard

PF1/PF13 ==> Help


PF3/PF15 ==> Logoff
PA1 ==> Attention
PA2 ==> Reshow
You may request specific help information by entering a '?' in any entry field

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

cl

By now, you should have arrived at the TSO/E LOGON panel of our lab system ESSMVS1.
You are now required to provide your user ID (if not already done), and the corresponding
password.
__ 1. Enter both and press Enter.

Ex

The following is a short description of each of the fields as they appear on the logon
panel:

A TSO user ID is 1 to 7 characters in length. It starts with


an alphabetic or national character (A-Z, #, , @).
All following characters can be alphanumeric or national
characters (A-Z, 0-9, #, , @).

pr

User ID

Password

The password is 1 to 8 alphanumeric or national


characters (A-Z, 0-9, #, , @). Any combination
of these characters can be used in the password.
Certain installation-specific rules might apply. The
password is not visible during logon.

Copyright IBM Corp. 2001, 2013

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-3

Student Exercises

A logon procedure name is required to log on to TSO. If


you have more than one logon procedure, the value
LOGON ensures that the procedure name entered is valid
for the account number that you might have also
entered. The procedure name is up to eight characters in
length. The first character has to be alphabetic. All
following characters can be alphanumeric or national
(A-Z, 0-9, #, , @).

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Procedure

If you have been provided an account number, you might


be required to enter it in order to logon to TSO. If the
account number is required and you omit it, you are
prompted to enter it. The account number has a
maximum of 40 characters.

Size

This entry allows you to specify a region size for your


TSO session. A default region size is used if none is
specified.

Perform

This field is reserved for your performance group. The


value has to be an integer from 1 to 255. Your installation
might have authorized performance group values for
you. If not, entering a value has no effect on your TSO
session.

Command

You can enter a TSO command at logon time. This is


processed after any command the TSO/E administrator
has entered in the PARM field on the EXEC statement of
the logon procedure. TSO/E does not execute the
command you enter in the COMMAND field if the
command specified in the PARM field of the logon
procedure fails.

New Password

If your user ID is defined to RACF, you might want to


change your password, or you might be required to do
so. To change your password, enter your current
password in the PASSWORD field, and then enter your
new password in this field. The same password rules as
for the old password apply. When you enter a new
password in this field, you are prompted to verify the
password. Only then, the password is changed.

pr

Ex

cl

Acct Nmbr

Group Ident

1-4

z/OS Fundamentals

If your user ID is defined to RACF, you can enter a RACF


Groupid. Your RACF Groupid can be up to eight
characters in length. The first character must be
alphabetic or national (A-Z, #, or @). The remaining
characters, if any, can also contain numerics (0-9).

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

-Nomail

By entering S before this option, you choose not to


display messages intended specifically for you during
logon processing. If you do not select this option, all
messages intended for you are displayed on your
terminal during logon.

-Nonotice

By entering S before this option, you elect not to receive


messages intended for all TSO users during logon
processing. If you do not select this option, all messages
intended for all TSO users are displayed on your
terminal during logon.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

EXempty

By entering s before this option, you indicate that you


want to reconnect your logon session if the session was
disconnected. If the session was not disconnected and
your user ID does not currently have a session
established, logon processing occurs.

-OIDcard

If your user ID is defined to RACF and you want to enter


data through the Operator Identification Card
(OIDCARD), you are prompted to do so during the logon
process. To enter data, slide your OIDCARD through
your OIDCARD reader attached to your terminal.

pr

Ex

cl

-Reconnect

Copyright IBM Corp. 2001, 2013

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-5

Student Exercises

Successful logon

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

ICH70001I TSOFT98 LAST ACCESS AT 10:19:59 ON MONDAY, OCTOBER 18, 2010


TSOFT98 LOGON IN PROGRESS AT 05:32:08 ON OCTOBER 19, 2010
*********************************************
***
THIS SYSTEM IS TO BE USED FOR
***
*** IBM MANAGEMENT APPROVED PURPOSES ONLY ***
*** USE IS SUBJECT TO AUDIT AT ANY TIME ***
***
BY IBM MANAGEMENT
***
*********************************************
-------------------------------------------------------If you have not selected a curriculum environment,
you will not be able to initialize ISPF/PDF.
Enter the environment selection command in the
TSO logon panel Command field. It will appear below:

-------------------------------------------------------%C12
========================================
***

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

What you see now depends upon how your installation has modified the logon process.
Some installations display one or more groups of messages at the top of the screen. In our
lab system, you should see messages similar to the ones displayed on the visual. You
should also see the word READY on the screen. It indicates that your logon was successful
and that TSO/E is now ready to process your command entry.

cl

(If you see *** rather than READY on your screen, press Enter to continue. TSO/E should
now display READY on your screen. If not, consult your instructor.)

Ex

We work with the Interactive System Productivity Facility/Program Development Facility


(ISPF/PDF) next.

pr

__ 2. To start ISPF/PDF, type ISPF or PDF (or an installation-defined alias) and press
Enter. Your terminal should now display the ISPF Primary Option Menu as shown
on the following page.

1-6

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

ISPF Primary Option Menu

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Menu Utilities Compilers Options Status Help


-----------------------------------------------------------------------------ISPF Primary Option Menu
Location :
Option ===>
0
1
2
3
4
5
6
7
8
C
E
S
SD
10
11

Settings
View
Edit
Utilities
Foreground
Batch
Command
Dialog Test
LM Facility
Classes
ITS Menu
ITS Schedule
SDSF
SCLM
Workplace

Terminal and user parameters


Display source data or listings
Create or change source data
Perform utility functions
Interactive language processing
Submit job for language processing
Enter TSO or Workstation commands
Perform dialog testing
Library administrator functions
Menus for specific Classes
ITS extended menu
ITS schedules
Syslog Display and Search Facility
SW Configuration Library Manager
ISPF Object/Action Workplace

User ID . :
Time. . . :
Terminal. :
Screen. . :
Language. :
Appl ID . :
TSO logon :
TSO prefix:
System ID :
MVS acct. :
Release . :

TSOFT98
05:33
3278
1
ENGLISH
ISR
STUDENT
TSOFT98
MVS1
1ES10G12
ISPF 5.9

Enter X to Terminate using log/list defaults

Welcome to IBM Education and Training - Level II support systems .....If you
have any problems or questions regarding these systems, Please call our help
desk. Thank you in advance for your time, patience and understanding.
Have a great day ........ Tech Support
F10=Actions F12=Cancel

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

We already introduced the ISPF Primary Option Menu and its main choices in the previous
topic.

pr

Ex

cl

__ 3. Your first task is now to alter the settings for your ISPF/PDF session. Select the
proper panel option (0), and proceed to the next page.

Copyright IBM Corp. 2001, 2013

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-7

Student Exercises

ISPF Settings

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Log/List Function keys Colors Environ Workstation Identifier Help


ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
ISPF Settings
Command ===>
More:
+
Options
Print Graphics
Enter "/" to select option
Family printer type 2
Command line at bottom
Device name . . . .
/ Panel display CUA mode
Aspect ratio . . . 0
/ Long message in pop-up
/ Tab to action bar choices
Tab to point-and-shoot fields
General
/ Restore TEST/TRACE options
Input field pad . . B
Session Manager mode
Command delimiter . ;
/ Jump from leader dots
Edit PRINTDS Command
/ Always show split line
Enable EURO sign
Member list options
Enter "/" to select option
/ Scroll member list
Allow empty member list
Allow empty member list (nomatch)
/ Empty member list for edit only
Terminal Characteristics
Screen format
2 1. Data

2. Std

Terminal Type
3
1. 3277
F1=Help
F2=Split
F3=Exit
F10=Actions F12=Cancel

3. Max

4. Part

2. 3277A
3. 3278
F7=Backward F8=Forward

4. 3278A
F9=Swap Nxt

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

Use this panel to familiarize yourself with the ISPF settings.

__ 4. Perform the following panel modifications and press Enter after each selection to
see how changes affect panel display.

cl

__ a. Display the command line at the top of the screen.

__ b. Change the display of the long message, so that it appears in a pop-up window.

Ex

__ c. Enter an invalid selection on the Command ===>______ line and press Enter. A
short message reading Invalid command should now appear in the upper right
corner of your screen.

pr

__ d. Now press F1 to display the corresponding long message. The message ...is
undefined should now appear in a pop-up window. Press F1 again for
additional help. Return to ISPF Settings panel.

__ e. To continue, clear the command line and press Enter again.

1-8

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ f.

Try the Tab key with and without Tab to action bar choices and Tab to
point-and-shoot fields selected.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

ISPF Settings: Action bar choices


Log/List Function keys Colors Environ Workstation Identifier Help
sssssssss EsssssssssssssssssssssssssssssssssssN ssssssssssssssssssssssssssssss
e 9 1. Non-Keylist PF Key settings e
Command = e
2. Keylist settings...
e
e
3. Tailor function key display e
More:
+
Options
e
*. Show all function keys
e Graphics
Enter " e
5. Show partial function keys e ly printer type 2
Comm e
6. Remove function key display e ce name . . . .
/ Pane e
*. Use private and shared
e ct ratio . . . 0
/ Long e
8. Use only shared
e
/ Tab e
9. Disable keylists
e
Tab e
*0. Enable keylists
e l
/ Rest DsssssssssssssssssssssssssssssssssssM t field pad . . B
Session Manager mode
Command delimiter . ;
/ Jump from leader dots
Edit PRINTDS Command
/ Always show split line
Enable EURO sign

Member list options


Enter "/" to select option
/ Scroll member list
Allow empty member list
Allow empty member list (nomatch)
/ Empty member list for edit only
Terminal Type
3
1. 3277
F1=Help
F2=Split
F3=Exit
F10=Actions F12=Cancel

2. 3277A
3. 3278
F7=Backward F8=Forward

4. 3278A
F9=Swap Nxt

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

__ 5. Select the Function keys choice of the action bar and hide the function key display.
Now reset it, so that the function key settings are once again displayed.

Ex

cl

__ 6. Select the Function keys choice of the Action bar again and select Disable
Keylists. Notice the change to the function keys. This setting (keylists disabled) is
the recommended setting for most z/OS users.

__ 7. Select Identifier from the action bar and activate the panel identifier display. Check
your panel for the panel name in the upper left corner.

pr

Panels can be modified, and this tells us the panelid (member name) of the panel.

Reset the panel identification display to off. You can also display the system name
and your user ID on every panel by activating the corresponding option.

__ 8. Return to the ISPF Primary Option Menu.


__ 9. Select the option View.

Copyright IBM Corp. 2001, 2013

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-9

Student Exercises

ISPF Settings: Function keys reset

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Log/List Function keys Colors Environ Workstation Identifier Help


-----------------------------------------------------------------------------MVS1 TSOFT98
ISPF Settings
Command ===>
More:
+
Options
Print Graphics
Enter "/" to select option
Family printer type 2
Command line at bottom
Device name . . . .
/ Panel display CUA mode
Aspect ratio . . . 0
/ Long message in pop-up
/ Tab to action bar choices
Tab to point-and-shoot fields
General
/ Restore TEST/TRACE options
Input field pad . . B
Session Manager mode
Command delimiter . ;
/ Jump from leader dots
Edit PRINTDS Command
/ Always show split line
Enable EURO sign
Member list options
Enter "/" to select option
/ Scroll member list
Allow empty member list
Allow empty member list (nomatch)
/ Empty member list for edit only
Terminal Characteristics
Screen format
2 1. Data

2. Std

Terminal Type
3
1. 3277
F1=HELP
F2=SPLIT
F3=END
F7=UP
F8=DOWN
F9=SWAP

3. Max

4. Part

2. 3277A
F4=RETURN
F10=LEFT

3. 3278
F5=RFIND
F11=RIGHT

4. 3278A
F6=RCHANGE
F12=RETRIEVE

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

F1 is always HELP.

F3 is always END or EXIT.

F9 has been reset to SWAP SCREEN.


F12 has been reset to RETRIEVE.

pr

Ex

cl

Others later, as needed.

1-10 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

View a data set

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Menu RefList RefMode Utilities Workstation Help


------------------------------------------------------------------------------MVS1 TSOFT98
View Entry Panel
Command ===>
ISPF Library:
Project . .
Group . . .
Type . . .
Member . .

. TSOFT98
. ES10
. CNTL
.

. . .

. . .

. . .

(Blank or pattern for member selection list)

Other Partitioned, Sequential or VSAM Data Set, or z/OS UNIX file:


Name . . . . . 'TSOFT98.ES10.TEXT'
Volume Serial
(If not cataloged)

Workstation File:
File Name . .

Initial Macro . .
Profile Name . . .
Format Name . . .
Data Set Password
Record Length . .

F1=HELP
F7=UP

.
.
.
.
.

Options
Confirm Cancel/Move/Replace
Browse Mode
View on Workstation
/ Warn on First Data Change
Mixed Mode
View ASCII data

.
.
.
.
.

F2=SPLIT
F8=DOWN

F3=END
F9=SWAP

F4=RETURN
F10=LEFT

F5=RFIND
F11=RIGHT

F6=RCHANGE
F12=RETRIEVE

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

__ 10. Enter DATA SET NAME....''userid.ES10.TEXT' ' as a data set name


(including the apostrophes), press Enter, and follow the instructions in the data set.
__________________________________________________________________

cl

__________________________________________________________________

pr

Ex

__________________________________________________________________

Copyright IBM Corp. 2001, 2013

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-11

Student Exercises

ISPF Primary Option Menu

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Menu Utilities Compilers Options Status Help


-----------------------------------------------------------------------------MVS1 TSOFT98
ISPF Primary Option Menu
Location :
Option ===> x
0
1
2
3
4
5
6
7
8
C
E
S
SD
10
11

Settings
View
Edit
Utilities
Foreground
Batch
Command
Dialog Test
LM Facility
Classes
ITS Menu
ITS Schedule
SDSF
SCLM
Workplace

Terminal and user parameters


Display source data or listings
Create or change source data
Perform utility functions
Interactive language processing
Submit job for language processing
Enter TSO or Workstation commands
Perform dialog testing
Library administrator functions
Menus for specific Classes
ITS extended menu
ITS schedules
Syslog Display and Search Facility
SW Configuration Library Manager
ISPF Object/Action Workplace

User ID . :
Time. . . :
Terminal. :
Screen. . :
Language. :
Appl ID . :
TSO logon :
TSO prefix:
System ID :
MVS acct. :
Release . :

TSOFT98
05:56
3278
1
ENGLISH
ISR
STUDENT
TSOFT98
MVS1
1ES10G12
ISPF 5.9

Enter X to Terminate using log/list defaults

F1=HELP
F7=UP

F2=SPLIT
F8=DOWN

F3=END
F9=SWAP

F4=RETURN
F10=LEFT

F5=RFIND
F11=RIGHT

F6=RCHANGE
F12=RETRIEVE

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

For the moment, our work with ISPF/PDF is done. We now want to end our ISPF/PDF
dialog and log off from our TSO session.
__ 11. To leave ISPF's Program Development Facility:
__ a. Enter X on the command line or

cl

__ b. Press F3 or

__ c. Select the corresponding Exit choice from the Menu pull-down menu.

pr

Ex

The heading of the next panel (as shown on the following visual) should read Specify
Disposition of Log Data Set.

1-12 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Log data set disposition

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Specify Disposition of Log Data Set


Command ===>
Log Data Set Disposition
1. Print data set and delete
Process option . . . 2
2. Delete data set without printing
3. Keep data set - Same
(allocate same data set in next session)
4. Keep data set - New
(allocate new data set in next session)
SYSOUT class . . . . A
Local printer ID
or writer-name . . .
List Data Set Options not available

Press ENTER key to complete ISPF termination.


Enter END command to return to the primary option menu.

Job statement information: (Required for system printer)


===> //USERID
JOB (ACCOUNT),'NAME'
===> //*
===> //*
===> //*

F1=Help
F7=Up

F2=Split
F8=Down

F3=Exit
F9=Swap

F4=
F10=Right

F5=RFind
F11=Left

F6=RChange
F12=Cursor

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

ISPF maintains a log of significant user activities. This information can be useful, for
example, when diagnosing problems. The log data is stored in a data set named
userid.SPFLOGx.LIST, where userid is the user ID supplied by the instructor.

cl

__ 12. At the end of an ISPF session you, as the user, can specify what has to be done with
the log data set. Enter the selection of your choice.

pr

Ex

Print data set and delete

Delete data set without printing

Copyright IBM Corp. 2001, 2013

Prints the data set, then deletes it. You


must specify an output class or a local
printer ID. If you specify an output
class, ISPF submits a background job
to print and delete the data set. If you
specify a local printer ID, ISPF uses
TSO's PRINTDS command to route the
data set to the printer and then deletes
the data set.
Just deletes the data set.

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-13

Student Exercises

Keep data set - Same

This option closes and frees the data


set and allocates the same data set in
the next session.

Keep data set - New

This option closes and frees the data


set but allocates a new data set when
starting the next ISPF session.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Delete data set without printing or Keep data set - Same is the usual choice unless you
have had problems.
If you do want to print, then the printer class (SYSOUT class) or destination (local printer
ID) must be entered. Additionally, the four lines of Job statement information must be
entered if you use the SYSOUT option.

pr

Ex

cl

The line List Data Set Options not available indicates there is no list data set to
print. If we performed a print under ISPF, then a similar set of options are provided to
dispose of the list data set.

1-14 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Logoff
TSOFT98.SPFLOG1.LOG has been deleted.
READY
logoff
TSOFT98 LOGGED OFF TSO AT 05:59:32 ON OCTOBER 19, 2010
******

Copyright IBM Corporation 2001, 2013. All Rights Reserved.


US Government Users Restricted Rights - Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp

You now have ended the ISPF session and returned to the TSO command line mode. Your
TSO session is still running.
__ 13. To terminate your TSO session, enter the TSO command logoff on your terminal.

Ex

cl

TSO then replies with a message like userid LOGGED OFF TSO AT 17:42:12 ON
OCT 23, 2010 to indicate that your TSO session has been terminated.

pr

End of exercise

Copyright IBM Corp. 2001, 2013

Exercise 1. System familiarization

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

1-15

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

1-16 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 2. Allocate new data sets


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to create commonly used data


set types and to get familiar with ISPF panel types.

What you should be able to do

At the end of the exercise, you should be able to:


Allocate data sets using ISPF panels

Be familiar with the operation of some ISPF panels

Requirements

ISPF Users Guide Vol I

SC34-4823

ISPF Users Guide Vol II

SC34-4820

ISPF Edit and Edit Macros

pr

Ex

cl

SC34-4822

Copyright IBM Corp. 2001, 2013

Exercise 2. Allocate new data sets

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

2-1

Student Exercises

Exercise instructions
Part 1: Allocate a physical sequential (PS) data set
__ 1. Allocate a new sequential data set named userid.ES10.PS according to the
following specifications:

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

2 tracks primary space and 1 track secondary space


Fixed-length records

Record length 80 bytes

9 records per single block

Note

Do not enter an expiration date; leave expiration date blank for all data sets that you
create in this class.

All other fields should be blank. Press the Enter key to allocate the file.

__ 2. To verify whether the data set has been allocated properly use the Data Set
Information panel.

Part 2: Allocate a partitioned data set (PDS)

__ 3. Allocate a new, partitioned organized data set named userid.ES10.PDS


according to the following specifications:
10 blocks primary space and 5 blocks secondary space
Directory size 2 blocks

Variable-length records

cl

Blocked records

Ex

Block size determined by system

Record length 255 bytes

pr

__ 4. To verify whether the data set has been allocated properly use the Data Set
Information panel.

Part 3: Allocate a partitioned data set extended (PDS/E)


__ 5. Allocate a new partitioned organized data set extended named
userid.ES10.PDSE according to the following specifications:
5 blocks primary space and 1 block secondary space
Directory size 5 blocks
2-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Fixed-length records

EXempty

Blocked records
Block size determined by system
Record length 80 bytes

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 6. To verify whether the data set has been allocated properly use the Data Set
Information panel.
Note

If you accidentally allocated the wrong data set, ask your instructor to delete it, so
you can start over again.

pr

Ex

cl

End of exercise

Copyright IBM Corp. 2001, 2013

Exercise 2. Allocate new data sets

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

2-3

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

2-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 3. ISPF editor primary commands


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to use ISPF editor primary


commands and inspect a simple REXX exec or program.

What you should be able to do

At the end of the exercise, you should be able to:

Use some of the more useful ISPF editor primary commands


Appreciate the advantages of a REXX program

Requirements

ISPF Users Guide Vol I

SC34-4823

ISPF Users Guide Vol II

SC34-4820

ISPF Edit and Edit Macros

pr

Ex

cl

SC34-4822

Copyright IBM Corp. 2001, 2013

Exercise 3. ISPF editor primary commands

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

3-1

Student Exercises

Exercise instructions
Use ISPF editor primary commands
__ 1. Create a member called LITLGAME in the data set you created called
userid.ES10.PDS.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 2. Edit LITLGAME, and copy in a member called SKELEXEC from the partitioned data
set called D80WW.ES10V11.EXEC.
__ 3. Perform the following modifications:

__ a. Set the boundaries to 1-8 and change all xxxxxxxx to ANSWER.

__ b. Reset the boundaries to 1-80 and change all xxxxxxxx to NUMBER.


__ c. Exclude all lines from the display.

__ d. Display the first line containing @@@ and overtype @@@ with SAY.

__ e. Use RFIND (F5) to find all further occurrences of @@@ and overtype them with
SAY as well.
__ f.

Show all lines on the display that might have been previously excluded.

__ g. The first line must contain a comment with the word REXX. REXX comments
start with a /* and end with an */. Put This is a little REXX-Exec (on
line 1) in comment signs /*...*/
__ h. Set the boundaries to 40-50 and change SAY to Y/N.

__ 4. Save your changes by entering Save on the command line.

__ 5. Try starting your little REXX-Exec by entering the following on the command line:
TSO EX 'userid.ES10.PDS(LITLGAME)' EXEC

Note

Ex

cl

To abort a running exec, press PA1 on your keyboard (right-click to bring up the
keypad), and enter HI as instructed. If the exec does not run or does not run
properly, go back to Step 1 and perform all steps again, but with a different member
name (as LITLGAME already exists).

pr

When you have finished playing computer games, take a few minutes to inspect
LITLGAME.
LITLGAME is written in a procedural language called REXX.

REXX programs (or execs) can be compiled or not, as you choose. This program
has not been compiled, and so it is interpreted as the instructions are executed,
resulting in poorer performance, but less administrative work.

3-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

End of exercise

Copyright IBM Corp. 2001, 2013

Exercise 3. ISPF editor primary commands

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

3-3

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

3-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 4. ISPF editor line command


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to use ISPF editor line


commands to move and copy text.

What you should be able to do

At the end of the exercise, you should be able to:


Move and copy text
Overlay text

Requirements

ISPF Users Guide Vol I

SC34-4823

ISPF Users Guide Vol II

SC34-4820

ISPF Edit and Edit Macros

pr

Ex

cl

SC34-4822

Copyright IBM Corp. 2001, 2013

Exercise 4. ISPF editor line command

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

4-1

Student Exercises

Exercise instructions
Part 1: ISPF editor line commands

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Enter the PROFILE edit command, and make sure that BOUNDS setting is set to 1 80, if
not reset it by entering: BOUNDS (with no left and right BOUNDS operands). Enter HILITE
AUTO to enable the coloring options for language sensitive coloring in the ISPF editor.
__ 1. Edit userid.ES10.PDS and open a new member called TABLE.
__ 2. Set up a line which looks exactly like this:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-000001 |
|
|
|
|

__ 3. Copy member TABLE from D80WW.ES10V11.CNTL after line 1.


__ 4. The data will look line this:
000002
000003
000004
000005
000006
000007
000008
000009
000010
000011

Smith
Brown
Davis
Harrison
Spencer
Lawson
White
McDonald
Bush
Newman

John
Sam
Roger
Tony
Fred
Edward
Annie
Steve
Gary
William

JSMITH
SBROWN
RDAVIS
HARRISON
FSPENCER
EDLAWSON
AWHITE
STEVEM
GBUSH
WNEWMAN

31431
31721
31976
32423
31212
31791
32111
31623
31885
31655

__ 5. Use copy/overlay, that is c and oo, to copy line 1 over the first four lines you copied
in, so the result looks like:
|
|
|
|
|

Smith
Brown
Davis
Harrison
Spencer
Lawson
White
McDonald
Bush
Newman

|
|
|
|
|

John
Sam
Roger
Tony
Fred
Edward
Annie
Steve
Gary
William

|
|
|
|
|

JSMITH
SBROWN
RDAVIS
HARRISON
FSPENCER
EDLAWSON
AWHITE
STEVEM
GBUSH
WNEWMAN

|
|
|
|
|

31431
31721
31976
32423
31212
31791
32111
31623
31885
31655

|
|
|
|
|

pr

Ex

cl

000001
000002
000003
000004
000005
000006
000007
000008
000009
000010
000011

4-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 6. Use move/overlay, that is m and oo, to move line 1 over the last six lines you copied
in, so the result looks like:
|
|
|
|
|
|
|
|
|
|

Smith
Brown
Davis
Harrison
Spencer
Lawson
White
McDonald
Bush
Newman

|
|
|
|
|
|
|
|
|
|

John
Sam
Roger
Tony
Fred
Edward
Annie
Steve
Gary
William

|
|
|
|
|
|
|
|
|
|

JSMITH
SBROWN
RDAVIS
HARRISON
FSPENCER
EDLAWSON
AWHITE
STEVEM
GBUSH
WNEWMAN

|
|
|
|
|
|
|
|
|
|

31431
31721
31976
32423
31212
31791
32111
31623
31885
31655

|
|
|
|
|
|
|
|
|
|

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

000001
000002
000003
000004
000005
000006
000007
000008
000009
000010

Note

The former line 1 has disappeared because of the move.

__ 7. Insert the following heading lines at the top of the table:

Family Name
Given Name
USERID
Phone
=============================TOP OF TABLE========================

__ 8. Insert the following trailing line at the bottom of the table:

==========================BOTTOM OF TABLE========================

Do this the efficient/lazy way by copying the second line to the end of the table and
overtyping TOP with BOTTOM.

__ 9. Exclude only the detail lines from display and sort them by their last name. (Use the
online help function to find out about the proper syntax to sort only the excluded
lines.)

cl

__ 10. Delete the entries Harrison through McDonald.


__ 11. Add a new line after Bush, and add:

Ex

| Cyrus

| Will

| WCYRUS

| 31823

| 31945

__ 12. Repeat entry Davis, and change the repeated line to:
| Davis

| Sarah

| SDAVIS

pr

__ 13. Insert a new line after Newman, and enter Claudia as first name.

__ 14. Use copy/overlay, that is c and o, to copy the old entry Newman over the new line.

__ 15. Change the user ID to CNEWMAN and the phone to 31654.

__ 16. Exclude the detail lines.


__ 17. Resort the detail lines by last name as the primary sort field and use given name as
the secondary sort field.
Copyright IBM Corp. 2001, 2013

Exercise 4. ISPF editor line command

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

4-3

Student Exercises

__ 18. Review sorted lines to very sort on primary and secondary names.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 19. Save your changes by entering Save on the command line.

pr

Ex

cl

End of exercise

4-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 5. Copy/move/rename/delete data sets


and members
What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to copy, move, rename and


delete members and data sets.

What you should be able to do

At the end of the exercise, you should be able to:


Perform some standard housekeeping tasks

Requirements

ISPF Users Guide Vol I

SC34-4823

ISPF Users Guide Vol II

SC34-4820

ISPF Edit and Edit Macros

pr

Ex

cl

SC34-4822

Copyright IBM Corp. 2001, 2013

Exercise 5. Copy/move/rename/delete data sets and members

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

5-1

Student Exercises

Exercise instructions
__ 1. Allocate two new data sets called userid.ES10.INDATA and
userid.ES10.OUTDATA. Allocate them like userid.ES10.PDS.
__ 2. Create a new member called A in serid.ES10.INDATA, and enter some test
data into it.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 3. Create nine new members called B through J which contain the same data as
member A.

__ 4. Copy the entire data set userid.ES10.INDATA into userid.ES10.OUTDATA.


__ 5. Change the contents of members D and H in userid.ES10.INDATA, and copy
these members again to userid.ES10.OUTDATA.
Make sure to specify the proper COPY options.
__ 6. Verify whether the members D and H have been copied correctly by editing or
viewing them.
__ 7. Delete userid.ES10.INDATA.

__ 8. Rename userid.ES10.OUTDATA to userid.ES10.DATA.

__ 9. Delete all members in userid.ES10.DATA except members A, D, and H.


__ 10. Rename these members to DATA1, DATA2, and DATA3.

__ 11. Move members DATA1 and DATA3 to userid.ES10.PDS.


__ 12. Delete userid.ES10.TEXT and userid.ES10.PDSE.

pr

Ex

cl

End of exercise

5-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 6. Data set lists


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to work with data set lists.

What you should be able to do

At the end of the exercise, you should be able to:

Understand the facilities provided by ISPF option 3.4, Data Set List

Use several of the functions available

Requirements

ISPF Users Guide Vol I

SC34-4823

ISPF Users Guide Vol II

SC34-4820

ISPF Edit and Edit Macros

pr

Ex

cl

SC34-4822

Copyright IBM Corp. 2001, 2013

Exercise 6. Data set lists

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

6-1

Student Exercises

Exercise instructions
Part 1: Data set lists
__ 1. Use the ISPF/PDF option Data Set List to perform the following tasks:
__ a. Display a list of all data set starting with your user ID.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

- What does the first entry user ID stand for?


_______________________________________________________

__ b. Determine the record length and block length of userid.ISPF.PROFILE.


- Record length: ____
- Block length: ____

__ c. Display a list of all members of userid.ES10.PDS, and then do the following:


i.

Delete member DATA1.

ii. Rename member DATA3 to DATA.

iii. Move member TABLE to data set userid.ES10.DATA.

__ d. Verify the move by displaying a member list of userid.ES10.DATA.


__ e. Delete member DATA2 of data set userid.ES10.DATA.
__ f.

Delete data set userid.ES10.PS.

__ g. Compress data set userid.ES10.DATA.

__ h. Determine the volume on which the data set userid.ES10.DATA resides.


__ i.

Press PF11 as necessary and answer the following questions:

- What is the number of allocated tracks of userid.ES10.CNTL?


- What is the %Used of userid.ES10.CNTL?

- What is the date userid.ES10.CNTL was created?

cl

- What is the catalog in which userid.ES10.DATA is cataloged?

List all data sets residing on the same volume as data set userid.ES10.DATA
that start with TSOF.
i.

Select the data set userid.ES10.DATA from your list and display all
members in the data set.

ii. Delete data set userid.ES10.DATA.

pr

Ex

__ j.

iii. Return to the ISPF Primary Option Menu.

6-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Part 2: UNIX directory list


Enter START on the Option command field, to start a new ISPF screen; you can now switch
form one session screen to the other using PF9, or using command SWAP LIST and select
the option screen you want to switch to.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 2. Now on this new screen, Use the ISPF/PDF option UNIX Directory List (option 3.17)
to perform the following tasks:
__ a. Display a list of all entries in the pathname /u/es10/students.
i.

On line beginning with Pathname, type in /u/es10/students.

- What type of entries are listed?


_______________________________________________________

Check column labeled TYPE using F8 to scroll the list.

- What is the size value for your directory TSOFS##? _______________

Check the column labeled SIZE.

__ 3. Display the entries in your directory TSOFS##.

__ 4. Create a new regular UNIX file in your directory: name it file1 with permission bits
755.

__ 5. Once created, edit the file, add one line containing the value date, and save it.
__ 6. Now try to execute this UNIX file, by entering X in front of it, and specify a run
method of 2. Login Shell .

What is the purpose of this UNIX file (program) that you have created?
__________________________________________________

Execute the UNIX date command under the shell:

Ex

cl

__ 7. Change the permission bits to 444, and try to execute it again. Any success?

pr

End of exercise

Copyright IBM Corp. 2001, 2013

Exercise 6. Data set lists

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

6-3

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

6-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 7. Using TSO/E commands


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to execute TSO commands,


modify an ISPF panel, and modify a CLIST.

What you should be able to do

At the end of the exercise, you should be able to:


Use TSO HELP

Perform minor modifications to CLISTs and ISPF panels

Requirements

ISPF Users Guide Vol I

SC34-4823

ISPF Users Guide Vol II

SC34-4820

ISPF Edit and Edit Macros

pr

Ex

cl

SC34-4822

Copyright IBM Corp. 2001, 2013

Exercise 7. Using TSO/E commands

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

7-1

Student Exercises

Exercise instructions
Part 1: TSO commands
__ 1. Use the proper TSO/E command to display only the function of the ALLOCATE
command.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 2. Use the proper TSO/E command to display only the syntax of the ALLOCATE
command.
__ 3. Find out the purpose of the LIKE operand of the ALLOCATE command.
__ 4. Allocate a new data set called userid.ES10.TSOEPDS.

Allocate the data set with the same characteristics as D80WW.ES10V11.PROC.

__ 5. Verify the proper allocation of userid.ES10.TSOEPDS by using a TSO/E


command to display its characteristics as well as those of D80WW.ES10V11.PROC.

__ 6. Allocate a new sequential data set called userid.ES10.TSOEPS with the following
characteristics:
Filename ALLOCPS

2 tracks primary space, 1 track secondary


Fixed-length records of 80 bytes
Blocked records

__ 7. Verify whether the data set has been allocated with the right filename by displaying a
list of all currently allocated data sets.
Make sure you specify the right parameter to see a list of filenames.
Does your filename occur?

__ 8. Enter the following command:


LISTDS ES10.TSOEPS

cl

__ 9. Display your TSO/E profile and change the prefix setting to HUGO.
__ 10. Enter the following command:

Ex

LISTDS ES10.TSOEPS

What happens and why?

______________________________________________________________

pr

__ 11. Reset the prefix to its previous value.


__ 12. Enter the following command:
LISTDS

__ 13. Change the profile setting to NOPROMPT.

7-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 14. Enter the following command:


LISTDS
What happens and why?
_______________________________________________________________

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 15. Reset the profile to PROMPT.


__ 16. Enter the following command:

LISTCAT ENT(userid.ES10.TSOEPDS) ALL

What is the volume on which the data set was allocated?

__ 17. Enter the following commands:

LISTCAT ENT(userid) ALIAS ALL

What is the purpose of this command, and what information is returned?


in which catalog is the alias defined?

LISTCAT LVL(userid)

What is the purpose of this command, and what information is returned?

__ 18. Enter the following command:

listc cat('ICFCAT.MVS100.UCAT.STUD1')

What is the purpose of this command, and what information is returned?


___________________________________________________

Steps 19 through 35 are optional. At any time, you can skip to Step 36.

__ 19. Create a new member called MYCLIST in data set userid.ES10.TSOEPDS.

__ 20. Copy a member called CLIST from data set D80WW.ES10V11.EXEC into member
MYCLIST.

cl

__ 21. Edit MYCLIST in userid.ES10.TSOEPDS.

Ex

Find the ISPPLIB ALLOC statement. Write the name of the first data set
here:___________________________________________________. We refer to
this as the ISPPLIB data set. Write the names of the other data sets
here:__________________________________________________.

pr

__ 22. Concatenate userid.ES10.TSOEPDS before all other libraries on the ISPPLIB


allocate statement.
__ 23. Save and exit when complete.
__ 24. Go to the Primary Option Menu.

Copyright IBM Corp. 2001, 2013

Exercise 7. Using TSO/E commands

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

7-3

Student Exercises

__ 25. Enter the command PANELID, and the name of this panel appears in the top left
hand corner. Write the panel name here:________________________. We refer to
this as the POM panel.
__ 26. Go to the panel which gives you a BookManager option (option E).

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Write the name of the panel here:___________________________. We call this the


Bookie panel.
__ 27. View the Bookie member in the ISPPLIB data set SYS1.PPPLIB.

__ 28. Find the )PROC section and note the code used to invoke BookManager.

Write the code here:________________________________________________.


To save typing, you could cut this code and paste it later.

__ 29. Edit a new member with the name of the POM panel (ITMENU) in data set
userid.ES10.TSOEPDS.
__ 30. Copy in the POM panel (ITMENU) member from the ISPPLIB library.
__ 31. Inspect the panel code:

__ a. Find the )BODY section and the text of the POM panel, in the )AREA section,
repeat last line W WLM, and override it as instructed below.
__ b. Add the text for your version of BookManager.

__ c. Find the )PROC section, and add a new entry that invokes BookManager using
the option you specified in the )BODY section and the command you copied from
the Bookie panel.
__ 32. End and save the panel member and the POM panel if necessary.
__ 33. Exit ISPF to TSO READY mode.

__ 34. Invoke MYCLIST by coding under TSO:

ex userid.ES10.TSOEPDS(MYCLIST)

cl

__ 35. Invoke BookManager from your customized panel.


Option E.z.

Ex

__ 36. Erase all data sets that you have allocated during this exercise.

pr

__ 37. Notify your neighboring group (through TSO command) that you have finished the
exercises.

End of exercise

7-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 8. Submit a job


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to submit jobs and inspect their


output.

What you should be able to do

At the end of the exercise, you should be able to:

Submit a job
Use SDSF to view job (or TSO) output on the spool
Purge output from the spool

Requirements

MVS JCL Reference


MVS JCL Users Guide
JES2 Introduction
JES3 Introduction
TSO/E Command Reference
SDSF Operation and Customization
ISPF Users Guide Vol I
ISPF Users Guide Vol II
ISPF Edit and Edit Macros

pr

Ex

cl

SA22-7597
SA22-7598
SA22-7535
SA22-7551
SA22-7782
SA22-7670
SC34-4822
SC34-4823
SC34-4820

Copyright IBM Corp. 2001, 2013

Exercise 8. Submit a job

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

8-1

Student Exercises

Exercise instructions
Part 1: LAB: Submit a job
Note

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Remember not to put single quotes around the data set name for batch JCL DD
statements.

__ 1. Allocate a partitioned data set named userid.ES10.CNTL with the following


characteristics:
1 cylinder primary and secondary space
10 blocks directory space

Record format fixed blocked


Logical record size 80
Block size 0

Note

Data set TSOFSxx.ES10.CNTL already exists, and can be used as it is with no


modifications to its allocation characteristics.

__ 2. Use option 3.3 to copy member LAB5#01 from data set D80WW.ES10V11.CNTL
into data set userid.ES10.CNTL.
__ 3. Edit member LAB5#01 in data set userid.ES10.CNTL.

cl

__ 4. Enter your JOB statement with the following specifications:

Account# is ........(See member JOBCARD in D80WW.ES10V11.CNTL).


Programmer's name is your name.

Message class is ......(See member JOBCARD in D8US.ES10V11.CNTL).


Message level is 1,1.

pr

Ex

Job name is useridA .... - (Yes, your user ID with an A at the end).

You are to be informed when the job has completed execution.


Run the job in Class ........(See member JOBCARD in
D80WW.ES10V11.CNTL).

__ 5. Complete the EXEC statement by calling the program IEBCOPY.

8-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 6. Complete the DD statements as follows:


__ a. SYSUT1 is D80WW.ES10V11.PROC.
__ b. SYSUT2 is a new data set called userid.ES10.PROC to be allocated with the
same characteristics as D80WW.ES10V11.PROC.
__ 7. Submit the job.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 8. View its output with SDSF. Leave the output on the spool.

pr

Ex

cl

End of exercise

Copyright IBM Corp. 2001, 2013

Exercise 8. Submit a job

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

8-3

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

8-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 9. JCL exercises


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to create and submit JCL that


performs standard tasks using common utility programs.

What you should be able to do

At the end of the exercise, you should be able to:


Understand how to code JCL statements for common utility
programs
Use SDSF to inspect job output
Perform common tasks using standard utilities

Requirements

MVS JCL Reference


MVS JCL Users Guide
SDSF Operation and Customization
DFSMS Using Data Sets
ISPF Users Guide Vol I
ISPF Users Guide Vol II
ISPF Edit and Edit Macros

pr

Ex

cl

SA22-7597
SA22-7598
SA22-7670
SC26-7410
SC34-4822
SC34-4823
SC34-4820

Copyright IBM Corp. 2001, 2013

Exercise 9. JCL exercises

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

9-1

Student Exercises

Exercise instructions
Part 1: Copy selected member of PDS

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 1. Create member LAB5#11 in data set userid.ES10.CNTL, and code an IEBCOPY


job to copy member JOBCARD from data set D80WW.ES10V11.CNTL into data set
userid.ES10.CNTL.
Here is a little help. Your job should look like the following:
//S1
EXEC PGM=IEBCOPY
//SYSPRINT DD SYSTOUT=*
//SYSUT1
DD DISP=SHR,DSN=
//SYSUT2
DD DISP=OLD,DSN=
//SYSIN
DD *
COPY ....=......,.....=......
SELECT MEMBER......

Note

Do not create a job card; TSO creates a default job card for you.

Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

__ 2. Now tailor the copied JOBCARD member so that this job card can be copied into
each new JCL member.
Your JOBCARD should look something like the following:

Ex

cl

//useridA JOB (ACCOUNT),'userid',MSGCLASS=_,MSGLEVEL=(1,1),


//
NOTIFY=userid,CLASS=B,REGION=6M
//*******************************************************************
*
//* JOB SUBMITTED FROM userid.ES10.CNTL(LAB5#XX)
***
//* DOC: WRITE THE PURPOSE OF YOUR JOB RIGHT HERE
***
//*******************************************************************
*

pr

The comment lines shown in the sample above are for documentation purposes so
that you will be able to trace from where the JCL was submitted.

__ 3. Save the changes to the member.

Part 2: Copy an entire data set


__ 4. Create member LAB5#12 in data set userid.ES10.CNTL.

9-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 5. Copy the member JOBCARD into it and create a job step that copies the (input) data
set userid.ES10.CNTL into (output) data set userid.COPY.CNTL.
Since the output data set does not exist, allocate it during the copy step. The
characteristics are the same as for userid.ES10.CNTL.
(Use the LIKE parameter to allocate the new data set.)

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 6. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

Part 3: Copy/replace a selected member

__ 7. Create member LAB5#13 in data set userid.ES10.CNTL.

__ 8. Copy the member JOBCARD into it and create a job step that copies member
JOBCARD from D80WW.ES10V11.CNTL into data set userid.COPY.CNTL with
the REPLACE option of IEBCOPY.

__ 9. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.
__ 10. Remember to replace the existing member. Please check this thoroughly.

Part 4: Perform a secure compress

Create member LAB5#14 in data set userid.ES10.CNTL. Copy the member JOBCARD
into it and create job steps that do the following:
__ 11. Use the first step to allocate a data set named userid.COMPRESS.DATA like data
set userid.COPY.CNTL

__ 12. The second step should only run when the RC=0 in the previous step. Use the
IF/THEN/ELSE clause for this purpose.
Copy the entire data set userid.COPY.CNTL into userid.COMPRESS.DATA, thus
creating a backup of userid.COPY.CNTL.

Ex

cl

__ 13. Check that the above step was successful using the IF/THEN/ELSE clause. If the
above steps were executed with RC=0, go on to LAB 5 #15, else delete
userid.COMPRESS.DATA, remove the cause of the error, and rerun the job.

Part 5: Compress a data set inplace

__ 14. Create member LAB5#15 in data set userid.ES10.CNTL.

pr

__ 15. Copy the member JOBCARD into it and create a job step that compresses the data
set userid.COPY.CNTL inplace.

__ 16. Delete data set userid.COMPRESS.DATA, but only if previous step was executed
with RC=0.
__ 17. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

Copyright IBM Corp. 2001, 2013

Exercise 9. JCL exercises

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

9-3

Student Exercises

Part 6: Copy a PDS and a PDSE data set


__ 18. First, create data set userid.COPY.PDS using ISPF option 3.2 with the following
characteristics:
1 TRK primary and 1 TRK secondary allocation

__ b. DSORG:

PDS

__ c. RECFM:

FB

__ d. DIR:

1 directory block

__ e. LRECL:

80

__ f.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ a. Space:

BLKSIZE:

__ 19. Second, create data set userid.COPY.PDSE using ISPF option 3.2 with the
following characteristics:
__ a. Space:

1 TRK primary and 1 TRK secondary allocation

__ b. DSORG:

PDSE

__ c. RECFM:

FB

__ d. DIR:

1 directory block

__ e. LRECL:

80

__ f.

BLKSIZE:

__ 20. Create member LAB5#16 in data set userid.ES10.CNTL.

__ 21. Copy the member JOBCARD into it and create a job step that copies data set
userid.ES10.CNTL into data set userid.COPY.PDS.

ATTENTION!

Ex

cl

DO NOT SUBMIT THE JOB NOW.

__ 22. Create member LAB5#17 in data set userid.ES10.CNTL.

pr

__ 23. Copy the member JOBCARD into it and create a job step that copies data set
userid.ES10.CNTL into data set userid.COPY.PDSE.

ATTENTION!

SAVE THE MEMBER AND SUBMIT BOTH JOBS.

9-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 24. Check the results of your jobs.


What is the difference between the two jobs?
__________________________________________________________________
What causes the difference?

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__________________________________________________________________

pr

Ex

cl

End of exercise

Copyright IBM Corp. 2001, 2013

Exercise 9. JCL exercises

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

9-5

Student Exercises

Optional exercises
Part 1: Copy instream data to PS
__ 1. Create member LAB5#21 in data set userid.ES10.CNTL.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 2. Code an IEBGENER job to copy data from instream data set to the newly allocated
data set userid.GENER.COPY#1.
The characteristics for the new data set are:
Space:

1 TRK primary and 1 TRK secondary allocation

DSORG:

PS

RECFM:

FB

DIR:

0 directory block

LRECL:

80

BLKSIZE:

The instream data could be like the following:


//...... DD *
TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

__ 3. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

Part 2: Copy a sequential data set

cl

__ 4. Create member LAB5#22 in data set userid.ES10.CNTL.

Ex

__ 5. Copy the member JOBCARD into it and create a job step that copies the (input) data
set userid.GENER.COPY#1 into (output data set userid.GENER.COPY#2.
Since the output data set does not exist yet, allocate it during the copy step. The
characteristics are the same as for userid.GENER.COPY#1. (Use the LIKE
parameter to allocate it.)

pr

__ 6. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

Part 3: Print a sequential data set to SYSOUT


__ 7. Create member LAB5#23 in data set userid.ES10.CNTL.
__ 8. Copy the member JOBCARD into it and create a job step that does the following:
9-6

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Print data set userid.GENER.COPY#1.

EXempty

__ 9. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

Part 4: Print a PDS member

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 10. Create member LAB5#24 in data set userid.ES10.CNTL.


__ 11. Copy the member JOBCARD into it and create a job step that prints the member
JOBCARD from userid.ES10.CNTL to SYSOUT=*.

__ 12. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

Part 5: Create a PDS member

__ 13. Create member LAB5#25 in data set userid.ES10.CNTL.

__ 14. Copy the member JOBCARD into it and create a job step that creates member
TEST in data set userid.COPY.CNTL.
The contents of member TEST should be:
TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

TEST
AAAA
BBBB
TEST

__ 15. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

pr

Ex

cl

End of exercise

Copyright IBM Corp. 2001, 2013

Exercise 9. JCL exercises

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

9-7

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

9-8

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 10.Procedures
What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to use procedures and the


SORT utility.

What you should be able to do

At the end of the exercise, you should be able to:


Use procedures

Make simple modifications to procedure JCL


Use the SORT utility

Requirements

MVS JCL Reference


MVS JCL Users Guide
JES2 Introduction
JES3 Introduction
SDSF Operation and Customization
z/OS DFSORT Getting Started
DFSMS Using Data Sets
ISPF Users Guide Vol I
ISPF Users Guide Vol II
ISPF Edit and Edit Macros

pr

Ex

cl

SA22-7597
SA22-7598
SA22-7535
SA22-7551
SA22-7670
SC26-7527
SC26-7410
SC34-4822
SC34-4823
SC34-4820

Copyright IBM Corp. 2001, 2013

Exercise 10. Procedures

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

10-1

Student Exercises

Exercise instructions
Part 1: Override DD-statements of an in-stream procedure
__ 1. Create member LAB5#31 in data set userid.ES10.CNTL and copy the same
member from data set D80WW.ES10V11.CNTL into it. It looks like:

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//userid1 JOB (ACCOUNT),'userid',MSGCLASS=X,MSGLEVEL=(1,1),


//
NOTIFY=userid,CLASS=B,REGION=6M
//********************************************************************
//*
JOB SUBMITTED FROM userid.ES10.CNTL(LAB5#31)
***
//*
DOC: Override DD-Statements on an Instream Procedure
***
//********************************************************************
//COMP
PROC
//**********************************************************
//********* MAKE BACKUP
//**********************************************************
//S1
EXEC PGM=IEBCOPY
//SYSPRINT DD
SYSOUT=*
//SYSUT1
DD
DISP=SHR,DSN=userid.ES10.CNTL
//SYSUT2
DD
DISP=(,CATLG),DSN=userid.ES10.BACK,
//
LIKE=userid.ES10.CNTL
//SYSIN
DD
DUMMY
//IFOK1
IF
(S1.RC=0) THEN
//**********************************************************
//********* COMPRESS DATA SET
//**********************************************************
//S2
EXEC PGM=IEBCOPY
//SYSPRINT DD
SYSOUT=*
//SYSUT1
DD
DISP=SHR,DSN=userid.ES10.CNTL
//SYSUT2
DD
DISP=OLD,DSN=userid.ES10.CNTL
//SYSIN
DD
DUMMY
//IFOKEND1 ENDIF
//IFOK2
IF
(S2.RC=0) THEN
//**********************************************************
//********* COMPRESS SUCCESSFUL, DELETE BACKUP
//**********************************************************
//S3
EXEC PGM=IEFBR14
//DD1
DD
DISP=(OLD,DELETE),DSN=userid.ES10.BACK
//IFOKEND2 ENDIF
//
PEND
//FINAL
EXEC COMP

As you can see, this job has an in-stream procedure that makes a secure
compress of data set userid.ES10.CNTL.

pr

__ 2. Your task is now to execute the job so that the data set userid.COPY.CNTL will be
compressed during the job's execution.
Do not change the in-stream procedure. Perform this task by overriding DD
statements.

10-2 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Part 2: Run cataloged procedure


__ 3. Create member LAB5#32 in data set userid.ES10.CNTL, and copy member
JOBCARD into it.
__ 4. Create a job step that runs a cataloged procedure stored in D80WW.ES10V11.PROC
-member COMP.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

The procedure looks like:

cl

***************************** Top of Data *****************************


//COMP
PROC INDS=FORGOTTEN,BACK=FORGOTTEN
//********************************************************************
//*
DOC: COMPRESS DATA SETS SPECIFIED WITH VARIABLES.
***
//********************************************************************
//**********************************************************
//********
MAKE BACKUP
//**********************************************************
//S1
EXEC PGM=IEBCOPY
//SYSPRINT DD
SYSOUT=*
//SYSUT1
DD
DISP=SHR,DSN=&INDS.
//SYSUT2
DD
DISP=(,CATLG),DSN=&BACK.,
//
LIKE=&INDS
//SYSIN
DD
DUMMY
//IFOK1
IF
(S1.RC=0) THEN
//**********************************************************
//********
COMPRESS DATA SET
//**********************************************************
//S2
EXEC PGM=IEBCOPY
//SYSPRINT DD
SYSOUT=*
//SYSUT1
DD
DISP=SHR,DSN=&INDS.
//SYSUT2
DD
DISP=OLD,DSN=&INDS.
//SYSIN
DD
DUMMY
//IFOKEND1 ENDIF
//IFOK2
IF
(S2,RC=0) THEN
//**********************************************************
//********
COMPRESS SUCCESSFUL, DELETE BACKUP
//**********************************************************
//S3
EXEC PGM=IEFBR14
//DD1
DD
DISP=(OLD,DELETE),DSN=&BACK.
//IFOKEND2 ENDIF

Ex

As you can see, there are two variables needed to run this procedure without
problems. Furthermore, you see that this is also a secure compress like the one you
had as an in-stream procedure.

pr

__ 5. Run this procedure to compress data set userid.ES10.CNTL and define


userid.ES10.BACK as the backup of the secure compress.

Part 3: Create cataloged procedure


__ 6. During this exercise, you will code a cataloged procedure in your own data set and
test it. It allows you to copy any kind of PDS or sequential data set to another PDS or
PS data set.

Copyright IBM Corp. 2001, 2013

Exercise 10. Procedures

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

10-3

Student Exercises

__ 7. Allocate a PDS named userid.ES10.PROC with the same attributes as data set
D80WW.ES10V11.PROC using ISPF/PDF function 3.2.
__ 8. Create the member COPY, which will hold the cataloged procedure. The procedure
should do the following:

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ a. Depending on the input variable, it calls IEBCOPY or IEBGENER. Name the


variable PROG.
The default for this variable is IEBCOPY.

__ b. The disposition of DD-statements SYSUT1 and SYSUT2 is defined as JCL


symbols. Name the symbols DISPI for input and DISPO for output.

__ c. The data set names should be variable so that they can vary from procedure call
to procedure call. Name their JCL symbols INDS and OUTDS.
__ d. The data set defined for SYSUT2 might be new. If this is the case, allocate it like
the input data set. Use the JCL symbol &LIKEDS to do this.
__ e. Do not specify any default values for the symbols except for PROG.
__ 9. Once you have created your own cataloged procedure, test it.

__ a. Create member LAB5#33 in data set userid.ES10.CNTL and copy member


JOBCARD into it.
__ b. Create job steps that call the new cataloged procedure to copy:
i.

Data set userid.ES10.CNTL to the new data set userid.ES10.XXXX.

ii. Data set userid.GENER.COPY#1 to the new data set userid.ES10.YYYY.

__ c. If the job fails, remove the cause of error and rerun the job.

Part 4: Use of DFSORT (ICEMAN)

__ 10. Create member LAB5#34 in data set userid.ES10.CNTL.

cl

__ 11. Copy member JOBCARD into it and create a job step that copies member
SORTTEST from data set D80WW.ES10V11.CNTL into your CNTL data set using
the SELECT MEMBER= function of IEBCOPY.

Ex

__ 12. Now create a job step that calls program ICEMAN which is the sort program
DFSORT.
This program needs the following DD statements:
DD
DD
DD
DD

SYSOUT=
DISP=....,DSN=.....
DISP=....,DSN=.....
*

pr

SYSOUT
SORTIN
SORTOUT
SYSIN

10-4 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

There are many input control statements, but you will need only the following ones:
SORT
FIELDS=(.........)
OPTION
SKIPREC=...
__ 13. Now that you have enough familiarity to create this sort step, do the following:

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Sort member SORTTEST of data set D80WW.ES10V11.CNTL and write the results
to userid.ES10.CNTL(SORTOUT1.

__ a. Skip the first record.

__ b. Sort by the number of years in the company (columns 1-3).


Data type is character (CH)
Descending order (D)

As the second sort criteria:

__ a. Sort the records by employee name, starting in column 4 until column 16.
Data type: character (CH)
Ascending order (A)

__ 14. Check the results of your job and edit member SORTOUT1 for the sorted output.

pr

Ex

cl

__ 15. In case of errors, remove the cause of errors and rerun the job.

Copyright IBM Corp. 2001, 2013

Exercise 10. Procedures

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

10-5

Student Exercises

Optional exercise
Part 1: Create PS from in-stream
__ 1. Create member LAB5#41 in data set userid.ES10.CNTL.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 2. Copy the member JOBCARD into it and create a job step that copies in-stream data
to a new physical sequential (PS) data set with name userid.ES10.INPUT and
the following characteristics:
__ a. Space:

1 track primary, no secondary allocation

__ b. RECFM:

FB

__ c. LRECL:

80

__ d. BLKSIZE:

Copy the in-stream data from member INSTREAM in data set


D80.ES10V11.CNTL. The in-stream data looks like this:
TEST1
TEST2
TEST3
TEST4
TEST5
TEST6
TEST7
TEST8
TEST9
TEST10
TEST11
TEST12
TEST13
TEST14
TEST15
TEST16

Use the //SYSUT1

DD DATA.... statement to define the input string.

cl

__ 3. Check the results of your job. In case of error, remove the cause and rerun the job.

Ex

Part 2: Conditional processing

__ 4. Create member LAB5#42 in data set userid.ES10.CNTL.

__ 5. Copy the member JOBCARD into it and create job steps that perform the following:

pr

__ a. Using IEBGENER, create a member named TEXT1 in the new data set
userid.ES10.DATA and copy in-stream data into it. The data should look like:
TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

10-6 z/OS Fundamentals

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

TEST
TEST
TEST
TEST
TEST
TEST

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ b. The data set userid.ES10.DATA must have the same characteristics as


userid.ES10.CNTL.
__ c. If the first step returns RC=0, copy member TEXT1 to a new PS data set named
userid.ES10.OUT
(1 trk primary, 1 trk secondary; fixed blocked; record length 80; best blocksize).

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ d. If the second step returns RC=0 then print data set userid.ES10.OUT to
SYSOUT=* using IEBGENER.

__ e. If the third step ends with RC=0, delete data set userid.ES10.OUT using
IEFBR14.

__ 6. For all conditional JCL, use the IF/THEN/ELSE clause.

__ 7. Check the results of your job. In case of error, remove the cause of the error and
rerun the job.

Part 3: Route a Job to INTRDR using IEBGENER

__ 8. First, copy member LAB5#43 from data set D80WW.ES10V11.CNTL and tailor it to
your needs. It should look like:
//useridA JOB (ACCOUNT),'userid',MSGCLASS=X,MSGLEVEL=(1,1),
//
NOTIFY=&SYSUID,CLASS=B,REGION=6M
//********************************************************************
//*
JOB SUBMITTED THROUGH INTRDR BY JOB LAB5#44 ***
//*
DOC: SUBMIT JOB THROUGH SYSOUT=(,INTRDR)
***
//********************************************************************
//S1
EXEC PGM=IEFBR14
//DD1
DD
DISP=SHR,DSN=userids.ES10.CNTL

__ 9. Second, create member LAB5#44 in data set userid.ES10.CNTL.

__ 10. Copy member JOBCARD into it and create a job step that performs the following:

cl

With the in-stream procedure PROC32, execute IEBGENER to route a job from any
input data set to SYSOUT=.
To define the input data set, use the symbol &DS, and for the SYSOUT= value, use
&OUT.

Ex

Run the in-stream procedure with the values:

DS=userid.ES10.CNTL(LAB5#43),OUT=(,INTRDR)

pr

__ 11. Check the results of your job. In case of errors, remove the cause of error and rerun
the job.

Copyright IBM Corp. 2001, 2013

Exercise 10. Procedures

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

10-7

Student Exercises

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

End of exercise

10-8 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Exercise 11.ISHELL and hierarchical file system


What this exercise is about

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

This exercise provides an opportunity to practice working with the


hierarchical file system using the ISHELL.

What you should be able to do

At the end of the exercise, students should be able to:

Invoke the ISHELL


Define functions that can be performed using the ISHELL
Describe how to use help information
Show how to use ISHELL to list the contents of a directory
Use the ISHELL to create a new file
Use the ISHELL to create a hierarchical file system
Copy members in a PDS to the file system
Change file permission bits
Rename and delete a file
Use the UDLIST function (3.17)

Requirements

MVS JCL Reference


MVS JCL Users Guide
JES2 Introduction
JES3 Introduction
DFSMS Using Data Sets
ISPF Users Guide Vol I
ISPF Users Guide Vol II
ISPF Edit and Edit Macros
UNIX System Services Users Guide
Using REXX and z/OS UNIX System Services

pr

Ex

cl

SA22-7597
SA22-7598
SA22-7535
SA22-7551
SC26-7410
SC34-4822
SC34-4823
SC34-4820
SA22-7801
SA22-7806

Copyright IBM Corp. 2001, 2013

Exercise 11. ISHELL and hierarchical file system

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

11-1

Student Exercises

Exercise instructions
Part 1: ISHELL introduction
__ 1. Log on to TSO.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 2. From the ISPF menu, choose the option to invoke the ISHELL or use the ISHELL
command (use the ISHELL TSO command to invoke the ISHELL).
There is also a panel option for the ISHELL on the ISPF menu, through
option E.7 (panel ITMENU).

__ 3. Use the pull-down menus from the action bar to see what actions can be performed.
The ISHELL screen is Common User Access (CUA) based. It has an
action bar at the top of the screen.

Placing the cursor under any of the actions listed on the action bar and
pressing the Enter key will result in a pop-up window (also called pop-up
menu or pull-down menu) for that action being displayed. The window
shows a list of actions that can be chosen.
Use the help key (PF1) on any field if you don't know what to do.

Question: Which actions can be done for a file system?

____________________________________________________________

Question: What does the asterisk on actions in the File_System and Setup
mean?
____________________________________________________________

Part 2: Introduction to the file system


Note

Ex

cl

Do not do the next step before saving the pathname displayed on the UNIX System
Services ISPF Shell. This pathname is both your home directory and your current working
directory. Write it down or copy it to the clipboard for pasting later.
Home directory = _______________________________________________________

pr

__ 4. List the contents of the root file system.

The name of the root file system is /.

If a / is not already specified on the ISH main panel, enter it like it is shown on
the following panel.
There are different methods for displaying the contents of a directory. See
if you can find one way of doing it.

11-2 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 5. List the contents of the directory bin in the root file system.
Find the directory bin on the root directory list and choose the option to
list its contents.
__ 6. Choose a file in this directory to browse.
The procedure is similar to the previous one, but the action is different.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Take notice that the short form of Browse is B. If you remember this you
can use B directly when you want to browse a file instead of prompting the
pop-up menu to choose actions from.

__ 7. List the contents of the directory dev in the root file system.

You can use the same way as you did to list the bin directory.

Suggestion: Try the action code for list instead of using the pop-up menu.

__ 8. Find out from the panels which type of files are located in the dev directory.
Try listing the attributes of a file.

Question: What type of files are located in the dev directory?

____________________________________________________________

__ 9. List the actions that can be done for the files in this directory.
The pop-up menu contains a list of actions.

Question: Which actions can be done for these files?

____________________________________________________________

__ 10. Create a new file called newfile in your home directory.

To create a new file, you have to go back to the main ISHELL panel.
Use the default permission bits for this file.

__ 11. Display the contents of your home directory now to see the new file there.

cl

Do this the same way as you listed the root directory.

Ex

__ 12. Edit the new file and add a few lines of text in the file.
The editor is the ISPF editor.

F3 saves the file and return from editing the file.

pr

Part 3: Customize ISHELL

__ 13. Modify the display of the directory contents to include information about permission
bits, modification time, owner, and file size.
__ 14. Display a directory with the additional information.
__ 15. Check the default actions for files.

Copyright IBM Corp. 2001, 2013

Exercise 11. ISHELL and hierarchical file system

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

11-3

Student Exercises

Question: What is the default action for character special files?


____________________________________________________________
__ 16. Specify that you want the command line to be on top of the ISHELL screen.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 17. Change it back to be at the bottom.

pr

Ex

cl

End of exercise

11-4 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

Optional exercises: Part 1


Part 1: Create a hierarchical file system
__ 1. Go into the ISHELL.
__ 2. List file systems that are already mounted.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Look under the action File_systems on the action bar.

__ 3. List the mount point of a mounted file system.

Choose a file system to display from the list of mounted file systems.
Look for an action that will display information about the file system.

Question: What is the mount point of the root file system?

____________________________________________________________

__ 4. Use the ISHELL to allocate a new file system called userid.OMVS.HFS. Allocate
one cylinder for primary and one cylinder for secondary space. The instructor
supplies you with information you need for storage class, management class, and
data class specifications.
Use the action File_systems on the action bar.

__ 5. List the contents of your home directory.

How to list a directory was done in Exercise 1.

Part 2: Step 2 (Managing files)

__ 6. Copy members FILE1, FILE2, FILE3 from the z/OS PDS called
D80WW.ES10V11.OMVS.LABS, to your home directory. Specify these file
permissions when copying the files:

Ex

cl

Owner: all permissions


Group: read
Other: none
Specify the copy options to select members from a member list, and to
make names lowercase.
Edit the field Permissions to specify the file permission bits.

__ 7. Rename file file1 to file9.

pr

On the panel where you must specify the new pathname of the file,
change only the last part of the pathname (which is the file name).

__ 8. Delete file file3.


When the panel to confirm the deletion is displayed, press the Enter key
to confirm that you want to delete the file and the file will be deleted.

Copyright IBM Corp. 2001, 2013

Exercise 11. ISHELL and hierarchical file system

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

11-5

Student Exercises

__ 9. Find the string test in the file file9, and call the output file findstr1 in your
home directory.
A panel is displayed where you can specify a pathname for the output file.
Another panel will be displayed where you can enter the text strings to be
searched for.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 10. Find the string test in your home directory and call the output file findstr2 in the same
directory.
The action for this is similar to the previous task, except that this is for a
directory.

What is the difference between the output from searching for a string in a file and
searching in a directory?
____________________________________________________________

__ 11. Set your working directory to your home directory.

Look under the action Directory on the action bar.

__ 12. Browse the contents of file file2 in your home directory using a relative pathname
on the ISHELL main panel.
The working directory can be referred to by a dot (.).

Question: How is the relative pathname specified?

____________________________________________________________

__ 13. Create a new directory in your home directory called labs. Use these permissions:

cl

Owner: read and write


Group: read and search
Other: read
Creating a new directory is similar to creating a new file.
Check the permission bits and set them according to the exercise
instructions. Use the Help key to find out what the numbers mean.

__ 14. Try to create a new file called Lab2a in the labs directory.

Ex

Creating a new file was done in a previous step.

Question: Explain what happens and why.

____________________________________________________________

pr

____________________________________________________________

__ 15. Change the permission bits for the labs directory to allow the owner to list the
directory and add new files in it.
Edit the mode fields to change the permission bits.

Question: What is the permission expressed in octal value that allows this?
____________________________________________________________
11-6 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 16. Try again to create a new file called Lab2a in the labs directory.
See previous instructions if you don't remember how to create a new file,
or use F1 to get help.
__ 17. Write a few lines of text in the new file.
Choose the Edit action to edit a file.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 18. Copy members PROG1, PROG2, PROG3 from the z/OS PDS called
D80WW.ES10V11.OMVS.LABS and add the suffix c to the files.

On the panel where you specify the name of the PDS and some copy
options, you can also specify a suffix for the files that will be copied.

__ 19. Create a new directory called newdir in your home directory.


Set the permissions value to 755.

__ 20. Compare the contents of directories labs and newdir.

__ 21. If you have time, try any other action that you would like to try, or some actions you
would like to practice more.

pr

Ex

cl

__ 22. Below are some additional optional exercises to get you more familiar with the ISPF
UNIX shell environment.

Copyright IBM Corp. 2001, 2013

Exercise 11. ISHELL and hierarchical file system

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

11-7

Student Exercises

Optional exercises: Part 2


__ 1. Use the pull-down menus from the action bar to see what actions can be performed.
The ISHELL screen is CUA (Common User Interface) based. It has an
action bar at the top of the screen. Note the use of PF10 and tab. (Make
sure you have enabled PFKEYS display with command PFSHOW ON.)

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Placing the cursor under any of the actions listed on the action bar and pressing
the Enter key, results in a pop-up window (also called pop-up menu or pull-down
menu) for that action being displayed. The window shows a list of actions that
can be chosen.
Use the help key (PF1) on any field if you do not know what to do.
Which actions can be done for File?

_______________________________________________________________
How can you display the attributes for a file or directory?

____________________________________________________________
What does the asterisk (*) on actions in the File_System and Setup mean?

____________________________________________________________

Part 1: Introduction to the file system


__ 1. List the contents of the root file system.

pr

Ex

cl

The name of the root file system is / (forward slash).

11-8 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

If / (forward slash) is not already specified on the ISH main panel, enter it as
shown on the following panel.

EXempty

File Directory Special_file Tools File_systems Options Setup Help


-----------------------------------------------------------------------UNIX System Services ISPF Shell
Enter a pathname and do one of these:

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

- Press Enter.
- Select an action bar choice.
- Specify an action code or command on the command line.

Return to this panel to work with a different pathname.

More:
/_______________________________________________________________
________________________________________________________________
________________________________________________________________

EUID=163770550

Command ===> ____________________________________________________________


F1=Help
F3=Exit
F5=Retrieve F6=Keyshelp F7=Backward F8=Forward
F10=Actions F11=Command F12=Cancel

There are different methods for displaying the contents of a directory. See
if you can find one way of doing it.

How did you do it?

_______________________________________________________________

__ 2. Display (list) the contents of the directory bin in the root file system.

__ a. Find the directory bin on the root directory list and choose the option to list its
contents.
- Did you do it the same way as above, for the root?

cl

____________________________________________________________

Ex

__ 3. Sort the directory list you just displayed. Sort items by size, then sort by last date.
For better viewing, make sure you enabled fields display in the directory list, by
going back to primary menu, then options, then dir list, and enable the fields to
display permission bits (octal display only), change time, owner, and size.

pr

__ a. Go back to root directory list (/); enter the command sort in the command line,
and select sort by size (or tab to Commands, then opt2s.
- Can you also sort by other criteria than size?

____________________________________________________________

Copyright IBM Corp. 2001, 2013

Exercise 11. ISHELL and hierarchical file system

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

11-9

Student Exercises

__ b. You can also put the cursor on any of the column titles to sort on the desired
criteria, and press Enter; try it for the Changed-GMT, Size, and Filename.
------Size
32768
8192
27
61440
184320
69632
172032

Filename Row 1 of 353


.
..
acl_edit
alias
ar
asa
at

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

EUID=1
/bin/
Type Perm Changed-GMT
Owner
_ Dir
755 2006-06-28 20:20 OMVSKERN
_ Dir
755 2006-07-08 17:25 OMVSKERN
_ Syml
777 2006-02-14 20:59 OMVSKERN
_ File
755 2005-05-17 17:51 OMVSKERN
_ File
755 2005-05-17 17:51 OMVSKERN
_ File
755 2005-05-17 17:51 OMVSKERN
_ File
755 2005-05-17 17:51 OMVSKERN

Default sort sequence is file name mixed case. How can this default be
changed?

____________________________________________________________

__ 4. Choose a file in /bin directory to browse.

__ a. Take note that the short form of Browse is B. If you remember this, you can use B
directly when you want to browse a file instead of prompting the pop-up menu to
choose actions from.
__ 5. Look at dev in the root file system.
__ a. Look at /dev.

- Is it a file or directory? Or something else?

____________________________________________________________

__ 6. If you want to display the content of /dev as a directory and not the content of the
symlink (it points to $SYSNAME/dev), you must append / (forward slash) after /dev,
and specify /dev/; try it now; it should display some special files like null, random,
console.
__ 7. Create some new files called newfile, newfile2.... in the /u/es10/students/tsofsxx
directory, where tsofsxx is your TSO user ID.

Ex

cl

__ a. To create a new file, you have to go back to the main ISHELL panel, input the file
name on the pathname (example: /u/es10/students/tsofsxx/newfile2), then press
Enter (or select option File, then 1 (New)).
__ b. Use filetype regular file, and set the permission bits to 755.

__ c. Select file source for regular file as edit.

pr

- Can you create an empty file this way?

____________________________________________________________

11-10 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty

__ 8. There is also another easier way to create a new file or directory using the ishell, by
entering n in front of the . special directory (see example below)
EUID=1
Type
n Dir
_ Dir
_ File

/u/tsa0001/
Filename
.
..
.sh_history

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

You are then prompted to create either a file (2) or directory (1) or else.

__ 9. Display the contents of your /u/es10/students/tsofsxx directory now to see the new
files there.
__ a. Do this the same way as you listed the root directory.
- Can you browse an empty file this way?

____________________________________________________________

__ 10. Edit one of the new files and add a few lines of text in the file.
The editor is the ISPF editor
PF3 saves the file and returns from editing the file.

Can you use another editor in this ISHELL environment?

______________________________________________________________
Note

The following items create three new files. Each create uses a different set of panels. This
demonstrates that there are frequently several ways to accomplish a task in the ISHELL.

__ 11. Create a new file called: /u/es10/students/tsofsxx/test1 using any method you want,
for instance:

cl

__ a. Enter the absolute pathname on the pathname line:


/u/es10/students/tsofsxx/test1

Ex

__ b. On the Action bar, select File.

__ c. On the pull-down menu, select New.


__ d. Set permission bits to: 755.

pr

__ 12. Create a new file called: /u/es10/students/tsofsxx/test2.


__ a. Enter the absolute pathname on the pathname line:
/u/es10/students/tsofsxx/test2
__ b. Press the Enter key.

__ c. Set permission bits to 755 and select option to create a regular file.

Copyright IBM Corp. 2001, 2013

Exercise 11. ISHELL and hierarchical file system

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

11-11

Student Exercises

__ 13. Create a new file called: /u/es10/students/tsofsxx/test3.


__ a. Enter the absolute pathname on the pathname line:
/u/es10/students/tsofsxx/test3.
__ b. On the command line, enter: n (the action code for creating a new file).
__ c. Set permission bits to 755 and select option to create a regular file.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ 14. Try to find in which filesystem all your UNIX files have been created.

__ a. In your /u/es10/students/tsofsxx, select any file, and enter U Filesystem, or tab to


File, then select opt15 (U).
- What is the filesystem name? ___________________________________
- Under which mount point was it mounted?_________________________

__ 15. Enable directory list reference.

__ a. Go back to Options on primary menu, then option 5 Advanced, then select /


Enable directory reference list.
__ b. Now go to Tools, then select option 4. Reference list(REF)...

__ c. You have a direct shortcut to any of the previously used directories, which you
can select using S or / (forward slash).

__ d. You can now use the ref command on any panel, to display the reference list.

Since z/OS 1.9, ISPF now provides a direct interface to edit/view/browse UNIX files and
directories. This interface is called UDLIST. In the VIEW (opt1) and EDIT (opt2) panels of
ISPF, you can now enter UNIX files and directory paths directly in the Other Partitioned,
Sequential or VSAM Data Set, or z/OS UNIX file, instead of specifying an MVS classical
non-UNIX data set.
__ 16. Go to ISPF primary option 2 (EDIT), and enter /u as the path name.

ISPF Library:
Project . .
Group . . .
Type . . .
Member . .

. TSOFT98
. ES10
. . .
. . .
. . .
. PDS
.
(Blank or pattern for member

Other Partitioned, Sequential or VSAM Data Set, or z/OS UNIX f


Name . . . . . /u/es10/students
Volume Serial
(If not cataloged)

pr

Ex

cl

ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
ISREDM01
Edit Entry Panel
Command ===>

Workstation File:
File Name . .

__ 17. Now select your own directory, by entering L in front of tsofsxx as the path name.

11-12 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

EXempty
Menu Utilities View Options Help
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
ISRUUDL0
z/OS UNIX Directory List
Row 1 to 6 o
Command ===>
Scroll ===> C
Pathname . : /u/es10/students/tsoft98

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Command Filename
Message
Type Permission Audit Ext Fmat
--------------------------------------------------------------------------.
Dir rwxr-xr-x fff--..
Dir rwxr-xr-x fff--.sh_history
File rw------- fff--- --s- ---file1
File rwxr-xr-x fff--- --s- nl
file2
File r--r--r-- fff--- --s- nl
test1
File rwxr-xr-x fff--- --s- ----

The same UDLIST interface is available in ISPF option 3.17; go to ISPF 3.17; you
can use the REFLIST panel option to retrieve and work with one of the last used
UNIX directories, or specify a starting directory name in the Pathname; try it with
your home directory /u/es10/students/tsoft98.

Menu RefList RefMode Utilities Options Help


ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
z/OS UNIX Directory List Utility
Option ===>
blank Display directory list

P Print directory list

Pathname . . . /u/es10/students/tsoft98

Enter "/" to select option


/ Confirm File Delete
/ Confirm Non-empty Directory Delete

pr

Ex

cl

Note that in the Options you can change the column arrangement, as well as the
width of columns.

Menu Utilities View Options Help


ssssssssssssssssssssss EssssssssssssssssssssssssssssssssssssssssssssN
e 1 1. Directory List Options...
e
Command ===>
e
2. Directory List Column Arrangement... e
e
3. Enable superuser mode(SU)
e
Pathname . : /u/tsa000 e
4. Refresh List
e
e
5. Save List
e
Command Filename
e
6. Reset
e
---------------------- DssssssssssssssssssssssssssssssssssssssssssssM
.
Dir rwxr-xr-x fff--..
Dir rwxr-xr-x fff--.ishell-reflist
File r-------- fff--- --s.sh_history
File rw------- fff--- --s-

Copyright IBM Corp. 2001, 2013

sssssss
o 8 of
==> PAG

Fmat
-------

-------

Exercise 11. ISHELL and hierarchical file system

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

11-13

Student Exercises

__ 18. You can also run USS commands from TSO option 6 with the OSHELL and execute
TSO command OSHELL to run various shell commands with the OSHELL. Try the
following under TSO command option 6:
__ a. OSHELL ps -ef
__ b. OSHELL ls -al

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

__ c. OSHELL id

__ d. OSHELL df

__ e. and so forth.
Note

The UNIX shell environment (OMVS) is not covered in this course; Courses OP05 (intro)
and OP25 (advanced) are the classes to be attended to learn more about z/OS Unix
System Services (USS).

pr

Ex

cl

End of exercise

11-14 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Appendix A. TSOFS01, TSOFS02, TSOFS03,


exercise solutions
JOBCARD

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXXA JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#XX) ***
//* DOC: WRITE THE PURPOSE OF YOUR JOB RIGHT HERE ***
//***************************************************************

LAB5#01

//TSOFSXXA JOB (5820),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#01) ***
//* DOC: ALLOCATE TSOFSXX.ES10.PROC AND COPY ENTIRE DATA SET***
//* D80WW.ES10V11.PROC. ***
//***************************************************************
//STEP1 EXEC PGM=IEBCOPY
//SYSUT1 DD DSN=D80WW.ES10V11.PROC,DISP=SHR
//SYSUT2 DD DISP=(,CATLG),DSN=TSOFSXX.ES10.PROC,
// LIKE=D80WW.ES10V11.PROC
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

cl

LAB5#11

//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#11) ***
//* DOC: JOBCARD automatically generated by SUBMIT Command ***
//***************************************************************
//STEP1 EXEC PGM=IEBCOPY
//IN DD DISP=SHR,DSN=D80WW.ES10V11.CNTL
//OUT DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY OUTDD=OUT,INDD=IN
SELECT MEMBER=JOBCARD

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-1

Student Exercises

LAB5#12

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX2 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//****************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#12) ***
//* DOC: ALLOCATE TSOFSXX.COPY.CNTL AND COPY ENTIRE DATA SET ***
//* TSOFSXX.ES10.CNTL. ***
//****************************************************************
//STEP1 EXEC PGM=IEBCOPY
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL
//SYSUT2 DD DISP=(,CATLG),DSN=TSOFSXX.COPY.CNTL,
//
LIKE=TSOFSXX.ES10.CNTL
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

LAB5#13

pr

Ex

cl

//TSOFSXX3 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//*****************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#13) ***
//* DOC: COPY MEMBER JOBCARD FROM D80WW.ES10V11.CNTL WITH REP ***
//*****************************************************************
//STEP1 EXEC PGM=IEBCOPY
//IN DD DISP=SHR,DSN=D80WW.ES10V11.CNTL
//OUT DD DISP=SHR,DSN=TSOFSXX.COPY.CNTL
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY OUTDD=OUT,INDD=IN
SELECT MEMBER=((JOBCARD,,R))

A-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

LAB5#14

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX4 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#14) **
//* DOC: DOES A SECURE COMPRESS. **
//* 1.STEP: ALLOCATE A TEMPORARY DATA SET **
//* 2.STEP: IF STEP1 RUNS WITH RC=0 **
//* ALLOCATE TSOFSXX.COMPRESS.DATA **
//* COPY TSOFSXX.COPY.CNTL INTO TSOFSXX.COMPRESS.DATA **
//* 3.STEP: IF STEP2 RUNS WITH RC=0 **
//* DELETE TSOFSXX.COMPRESS.DATA **
//***************************************************************
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DISP=(,CATLG),DSN=TSOFSXX.COMPRESS.DATA,
// LIKE=TSOFSXX.COPY.CNTL
//TESTS1 IF (STEP1.RC=0) THEN
//STEP2 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.COPY.CNTL
//SYSUT2 DD DISP=SHR,DSN=TSOFSXX.COMPRESS.DATA
//SYSIN DD DUMMY
//ENDIFS1 ENDIF
//TESTS12 IF ((STEP1.RC NE 0) OR (STEP2.RC NE 0)) THEN
//DELETE EXEC PGM=IEFBR14
//DD1 DD DISP=(OLD,DELETE),DSN=TSOFSXX.COMPRESS.DATA
//ENDIFS12 ENDIF

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-3

Student Exercises

LAB5#15

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX5 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#15) **
//* DOC: COMPRESS DATA SET TSOFSXX.COPY.CNTL INPLACE **
//***************************************************************
//STEP1 EXEC PGM=IEBCOPY
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.COPY.CNTL
//SYSUT2 DD DISP=SHR,DSN=TSOFSXX.COPY.CNTL
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//TESTS1 IF ((STEP1.RC=0)
THEN
//DELETE EXEC PGM=IEFBR14
//DD1 DD DISP=(OLD,DELETE),DSN=TSOFSXX.COMPRESS.DATA
//ENDIFS1 ENDIF

LAB5#16

pr

Ex

cl

//TSOFSXX6 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//****************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#16) ***
//* DOC: COPY DATA SET TSOFSXX.ES10.CNTL INTO DATA SET ***
//* TSOFSXX.COPY.PDS ***
//****************************************************************
//STEP1 EXEC PGM=IEBCOPY
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL
//SYSUT2 DD DISP=SHR,DSN=TSOFSXX.COPY.PDS
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

A-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

LAB5#17

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX7 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//****************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#17) ***
//* DOC: COPY DATA SET TSOFSXX.ES10.CNTL INTO DATA SET ***
//* TSOFSXX.COPY.PDSE ***
//****************************************************************
//STEP1 EXEC PGM=IEBCOPY
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL
//SYSUT2 DD DISP=SHR,DSN=TSOFSXX.COPY.PDSE
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

LAB5#21

cl

//TSOFSXX1 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#21) **
//* DOC: COPY INSTREAM DATA INTO NEW ALLOCATED DATA SET **
//* TSOFSXX.GENER.COPY#1 **
//***************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DATA,DLM=##
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA
BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
##
//SYSUT2 DD DISP=(,CATLG),DSN=TSOFSXX.GENER.COPY#1,
// SPACE=(CYL,(1,1,0)),LRECL=80,BLKSIZE=0,RECFM=FB
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-5

Student Exercises

LAB5#22

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX2 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#22) **
//* DOC: COPY DATA SET TSOFSXX.GENER.COPY#1 **
//* INTO NEW ALLOCATED DATA SET TSOFSXX.GENER.COPY#2 **
//***************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.GENER.COPY#1
//SYSUT2 DD DISP=(,CATLG),DSN=TSOFSXX.GENER.COPY#2,
// LIKE=TSOFSXX.GENER.COPY#1
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

LAB5#23

//TSOFSXX3 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#23) ***
//* DOC: PRINT DATA SET TSOFSXX.GENER.COPY#1. ***
//***************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.GENER.COPY#1
//SYSUT2 DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

cl

LAB5#24

pr

Ex

//TSOFSXX4 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//****************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#24) ***
//* DOC: PRINT MEMBER "JOBCARD" FROM DSET TSOFSXX.ES10.CNTL. ***
//****************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL(JOBCARD)
//SYSUT2 DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

A-6

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

LAB5#25

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX5 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#25) ***
//* DOC: CREATE MEMBER "TEST" IN PDS "TSOFSXX.COPY.CNTL" FROM***
//* INSTREAM DATA. ***
//****************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DATA,DLM=##
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA AAAA
BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
##
//SYSUT2 DD DISP=OLD,DSN=TSOFSXX.COPY.CNTL(TEST)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-7

Student Exercises

LAB5#31

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX1 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#31) ***
//* DOC: OVERWRITE DD STATEMENTS ON A INSTREAM PROCEDURE ***
//***************************************************************
//COMP PROC
//************************************************************
//*****
MAKE BACKUP
//************************************************************
//S1 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1
DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL
//SYSUT2
DD DISP=(,CATLG),DSN=TSOFSXX.ES10.BACK,
// LIKE=TSOFSXX.ES10.CNTL
//SYSIN DD DUMMY
//************************************************************
//*****
COMPRESS DATA SET
//************************************************************
//IFOK1
IF (S1.RC=0) THEN
//S2
EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT1
DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL
//SYSUT2
DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL
//SYSIN
DD DUMMY
//IFOKEND1 ENDIF
//************************************************************
//*****
COMPRESS SUCCESSFUL, DELETE BACKUP
//************************************************************
//IFOK2
IF (S2.RC=0) THEN
//S3
EXEC PGM=IEFBR14
//DD1
DD DISP=(OLD,DELETE),DSN=TSOFSXX.ES10.BACK
//
ELSE
//IFOKEND2 ENDIF
//
PEND
//FINAL
EXEC COMP
//S1.SYSUT1 DD DSN=TSOFSXX.COPY.CNTL
//S1.SYSUT2 DD DSN=TSOFSXX.ES10.BACK,LIKE=TSOFSXX.ES10.CNTL
//S2.SYSUT1 DD DSN=TSOFSXX.COPY.CNTL
//S2.SYSUT2 DD DSN=TSOFSXX.COPY.CNTL
//S3.DD1
DD DSN=TSOFSXX.ES10.BACK

A-8

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

LAB5#32

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX2 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#32) ***
//* DOC: OVERWRITE CATALOGUED PROCEDURE ***
//***************************************************************
//SEARCH JCLLIB ORDER=(D80WW.ES10V11.PROC)
//START EXEC PROC=COMP,
// INDS=TSOFSXX.ES10.CNTL,
// BACK=TSOFSXX.ES10.BACK

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-9

Student Exercises

LAB5#33

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX3 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#33) ***
//* DOC: OVERWRITE OWN CATALOGUED PROCEDURE ***
//***************************************************************
//SEARCH JCLLIB ORDER=(D80WW.ES10V11.PROC)
//IEBCOPY EXEC PROC=COPY,
// PROG=IEBCOPY,
// DISPI=SHR,
// INDS=TSOFSXX.ES10.CNTL,
// DISPO='(,CATLG)',
// OUTDS=TSOFSXX.ES10.XXXX,
// LIKEDS=TSOFSXX.ES10.CNTL
//IEBGENER EXEC PROC=COPY,
// PROG=IEBGENER,
// DISPI=SHR,
// INDS=TSOFSXX.GENER.COPY#1,
// DISPO='(,CATLG)',
// OUTDS=TSOFSXX.ES10.YYYY,
// LIKEDS=TSOFSXX.GENER.COPY#1
//*
END OF JOB

pr

Ex

cl

................................................................
//*THE CATALOGUED PROCEDURE, COPY, SHOULD BE LIKE THE FOLLOWING //*
//COPY
PROC PROG=IEBCOPY,INDS=,DISPO=,OUTDS=,LIKEDS
//S1
EXEC PGM=&PROG
//SYSUT1
DD DISP=&DISPI,DSN=&INDS
//SYSUT2
DD DISP=&DISPO,DSN=&OUTDS,
//
LIKE=&LIKEDS
//SYSPRINT DD SYSOUT=*
//SYSIN
DD DUMMY
................................................................

A-10 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

LAB5#34

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX1 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#34) **
//* DOC: COPY MEMBER "SORTTEST" FROM "D80WW.ES10V11.CNTL" THEN**
//* USE ICEMAN (DFSORT) TO SORT DATA FROM DATA SET **
//* "TSOFSXX.ES10.CNTL(SORTTEST) **
//***************************************************************
//COPY EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//IN1 DD DISP=SHR,DSN=D80WW.ES10V11.CNTL
//OUT1 DD DISP=OLD,DSN=TSOFSXX.ES10.CNTL
//SYSIN DD *
COPY OUTDD=OUT1,INDD=IN1
SELECT MEMBER=(SORTTEST)
//SORT EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=TSOFSXX.ES10.CNTL(SORTTEST)
//SORTOUT DD DISP=OLD,DSN=TSOFSXX.ES10.CNTL(SORTOUT1)
//SYSIN DD *
SORT FIELDS=(1,3,CH,D,4,12,CH,A)
OPTION SKIPREC=1

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-11

Student Exercises

LAB5#41

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX1 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#41) ***
//* DOC: CREATE TEST DATA IN PS "TSOFSXX.ES10.INPUT" FROM ***
//* INSTREAM DATA. ***
//***************************************************************
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DATA,DLM=##
TEST1
TEST2
TEST3
TEST4
TEST5
TEST6
TEST7
TEST8
TEST9
TEST10
TEST11
TEST12
TEST13
TEST14
TEST15
TEST16
##
//SYSUT2
DD DISP=(,CATLG),DSN=TSOFSXX.ES10.INPUT,
// SPACE=(TRK,(1,0)),RECFM=FB,LRECL=80,BLKSIZE=0
//SYSPRINT DD SYSOUT=*
//SYSIN
DD DUMMY

A-12 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

LAB5#42

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXX1 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#42) *
//* DOC: CREATE PDS "TSOFSXX.ES10.DATA" *
//* FILL MEMBER TEXT1 WITH INSTREAM DATA *
//* COPY MEMBER TEXT1 TO NEW PS "TSOFSXX.ES10.OUT" *
//* PRINT PS "TSOFSXX.ES10.OUT" TO SYSOUT=* *
//* IF RC=0 DELETE PS "TSOFSXX.ES10.OUT" *
//***************************************************************
//S1 EXEC PGM=IEBGENER
//SYSUT1 DD DATA,DLM=##
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
##
//SYSUT2 DD DISP=(,CATLG),DSN=TSOFSXX.ES10.DATA(TEXT1),
// LIKE=TSOFSXX.ES10.CNTL
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//IFS1OK IF (S1.RC=0) THEN
//S2 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.ES10.DATA(TEXT1)
//SYSUT2 DD DISP=(,CATLG),DSN=TSOFSXX.ES10.OUT,
// SPACE=(TRK,(1,1)),RECFM=FB,LRECL=80,BLKSIZE=0
//SYSIN DD DUMMY
//ENDIFS2 ENDIF
//IFS2OK IF (S2.RC=0) THEN
//S3 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=TSOFSXX.ES10.OUT
//SYSUT2 DD SYSOUT=*
//SYSIN DD DUMMY
//ENDIFS3 ENDIF
//IFS3OK IF (S3.RC=0) THEN
//S4 EXEC PGM=IEFBR14
//DD1 DD DISP=(OLD,DELETE),DSN=TSOFSXX.ES10.OUT
//ENDIFS4 ENDIF

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-13

Student Exercises

LAB5#43

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//TSOFSXXA JOB (ACCOUNT),'ES100',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=&SYSUID,CLASS=B,REGION=6M
//***************************************************************
//* JOB SUBMITTED THROUGH INTRDR by LAB5#44 ***
//* DOC: SUBMIT JOB THROUGH SYSOUT=(,INTRDR) ***
//*************************************************************
//S1 EXEC PGM=IEFBR14
//DD1 DD DISP=SHR,DSN=D80WW.ES10V11.CNTL

LAB5#44

pr

Ex

cl

//TSOFSXX2 JOB (ACCOUNT),'TSOFSXX',MSGCLASS=Q,MSGLEVEL=(1,1),


// NOTIFY=TSOFSXX,CLASS=B,REGION=6M
//****************************************************************
//* JOB SUBMITTED FROM TSOFSXX.ES10.CNTL(LAB5#44) ***
//* DOC: USE IEBGENER TO ROUTE ANY JOB TO INTRDR ***
//* will submit LAB5#43 JOB TO INTRDR ***
//****************************************************************
//PROC32 PROC DS=FORGOTTEN,OUT=*
//S1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=&DS.
//SYSUT2 DD SYSOUT=&OUT.
//* LIKE=TSOFSXX.ES10.CNTL
//SYSIN DD DUMMY
// PEND
//RUNPROC EXEC PROC=PROC32,
// DS=TSOFSXX.ES10.CNTL(LAB5#43),
// OUT=(,INTRDR)

A-14 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

SORTOUT1
Johanna Josef 0976543 RZ
Zulupali Wolf 3131515 RZ
Zieglei Erich 1111123 VS
Aar Rolf 1131515 RZ
Bachlauf Josef 4011124 RZ
Barney Werner 3002511 RZ
Bausch Hugo 7002314 V8
Endrebex Werner 7239744 RZ
Aar Karl 1002000 V6
Albert Otto 1002222 V7
Binsen Josef 2002311 RZ
Bruckner Hugo 8002313 V3
Degenfest Ernst 6877777 V0
Duftnote Otto 6232323 RZ
Engadino Otto 1111222 RZ
Gretschg Otto 8822233 MZ
Grossauf Josef 1172922 RZ
Max Hugo 0974758 RZ
Ortgang Josef 1171819 RZ
Porter Ernst 4228645 AZ
Reichel Josef 0001010 AZ
Rockel Heinrich 1123456 RZ
Salfer Karl 0974365 BZ
Szab Gustav 1221022 BZ
Weiss Heinz 3345303 AZ
Wittmed Karl 0519751 RZ

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

5
4
3
2
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix A. TSOFS01, TSOFS02, TSOFS03, exercise solutions

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

A-15

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

A-16 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Appendix B. JCL: Examples


JCL -useful sample JCLs for any use
JCL Examples of DD Statements for Existing data

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Sample DD Statements for Creating data


Defining VSAM

Examples of IDCAMS to Print

Examples of IDCAMS to copy

Examples of Running TSO in batch, running REXX


Examples of ISPF Compare in batch
Example of a Safe Compress
Example of Copying a PDS
IEFBR14

AMBLIST - Show Load Module Attribute

cl

SORT Examples

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-1

Student Exercises

JCL Examples of DD Statements for Existing data


Open for INPUT to READ. Open for OUTPUT to completely replace VSAM
//ddname DD DSN=dataset-name,DISP=SHR

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Example:
//INFILE DD DSN=MY.DATASET.DATA,DISP=SHR

SEQUENTIAL
File is not present.
//ddname DD DUMMY,
//
DCB=(LRECL=rec-len,BLKSIZE=blk-size,RECFM=rec-format)
Example:
//INFILE DD DUMMY,
//
DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)

In-stream data. 80 characters, fixed format


//ddname DD *
data goes here
/*
Example:
//INFILE DD *
Linda
Ellen
/*

cl

Disk or Tape non-gdg, non-pds member.


//ddname DD DSN=dataset-name,DISP=SHR

Ex

Example:
//INFILE DD DSN=MY.DATASET.DATA,DISP=SHR

pr

Disk or tape, gdg.


//ddname DD DSN=dataset-name(0),DISP=SHR

Example:
//INFILE DD DSN=MY.DATASET.DATA(0),DISP=SHR

B-2

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Disk, existing PDS member.


//ddname DD DSN=dataset-name(member-name),DISP=SHR

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Example:
//INFILE DD DSN=MY.DATASET.DATA(M1),DISP=SHR

Temporary disk. Previously Passed


//ddname DD DSN=&&dataset-name,DISP=(OLD,DELETE)

or OLD,PASS

Example:
//INFILE DD DSN=&&TEMP,DISP=(OLD,DELETE)

Sample DD Statements for Creating data

Open for OUTPUT only

VSAM
//ddname DD DSN=dataset-name,DISP=SHR

Example:
//INFILE DD DSN=MY.DATASET.DATA,DISP=SHR
SEQUENTIAL

Throw away the file.


//ddname DD DUMMY,
//
DCB=(LRECL=rec-len,BLKSIZE=blk-size,RECFM=rec-format)

cl

Example:
//INFILE DD DUMMY,
//
DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)

Ex

AP

Spooled to printer
//ddname dd SYSOUT=printer-class

pr

Example:
//OUTFILE DD SYSOUT=*

Disk, non-gdg, non-pds member.


//ddname DD DSN=dataset-name,DISP=(NEW,CATLG,DELETE),

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-3

Student Exercises

//

UNIT=diskunit,SPACE=(TRK,1)

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Example:
//OUTFILE DD DSN=MY.DATASET.DATA,DISP=(NEW,CATLG,DELETE),
//
UNIT=SYSDA,SPACE=(TRK,1)

Tape, non-gdg.
//ddname DD DSN=dataset-name,DISP=(NEW,CATLG,DELETE),
//
UNIT=tapeunit
//* other parameters may be required by your company

Example:
//ddname DD DSN=MY.DATASET.DATA,DISP=(NEW,CATLG,DELETE),
//
UNIT=TAPE
//* other parameters may be required by your company

Disk, sequential gdg.


//ddname DD DSN=dataset-name(+1),DISP=(NEW,CATLG,DELETE),
//
UNIT=diskunit,SPACE=(TRK,1),
//
DCB=model-dscb
optional at some companies

Example:
//OUTFILE DD DSN=MY.DATASET.DATA(+1),DISP=(NEW,CATLG,DELETE),
//
UNIT=SYSDA,SPACE=(TRK,1),
//
DCB=MODEL.DSCB
optional at some companies. find its name

Disk, new or existing PDS member. Existing member will be overwritten


//ddname DD DSN=dataset-name(member-name),DISP=SHR

Ex

cl

Example:
//OUTFILE DD DSN=MY.DATASET.DATA(M1),DISP=SHR

pr

Temporary disk..
//ddname DD DSN=&&dataset-name,DISP=(NEW,PASS,DELETE),
//
UNIT=diskunit,SPACE=(TRK,1)
Example:
//OUTFILE DD DSN=&&TEMP,DISP=(NEW,PASS,DELETE),
//
UNIT=SYSDA,SPACE=(TRK,1)

B-4

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Temporary disk. Not used again in same job. A work file.


//ddname DD UNIT=diskunit,SPACE=(TRK,1)
Example:
//OUTFILE DD UNIT=SYSDA,SPACE=(TRK,1)

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Tape, gdg.
//ddname DD DSN=dataset-name(+1),DISP=(NEW,CATLG,DELETE),
//
UNIT=tapeunit,
//
DCB=model-dscb
optional at some companies

cl

Example:
//OUTFILE DD DSN=MY.DATASET.DATA(+1),DISP=(NEW,CATLG,DELETE),
//
UNIT=TAPE,
//
DCB=MODEL.DSCB
optional at some companies. find out it

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-5

Student Exercises

Defining VSAM

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//*
DEFINE A VSAM KSDS
//DEFKSDS EXEC PGM=IDCAMS
//SYSPRINT DD
SYSOUT=*
//SYSIN
DD
*
/* the trailing - is for continuation */
/* if delete fails there will be an error message which you can ignore */
DELETE (userid.VSAM.KSDS) CLUSTER
DEFINE CLUSTER NAME(userid.VSAM.KSDS) CYLINDERS(1,1)
KEYS(10,0) /* length displacement */ RECORDSIZE(80,80) /* avg max */
INDEXED) /* ksds */
/*
Some options for defining VSAM:
RECOVERY
SPEED
UNIQUE

Allow a restart of a load.


Opposite of recovery.
The cluster will not be part of a dataspace containing other
clusters.
Opposite of unique.
Copy each index record on the track as many times as it will fit.
Opposite of unique.
If there is data in the cluster, a repro or load will clobber the
existing data.
Can do only one repro or load on this cluster.
region system

SUBALLOCATE
REPLICATE
NOREPLICATE
REUSE

cl

NOREUSE
SHAREOPTIONS

pr

Ex

region means roughly this CICS (an MVS can have more than one CICS
running)
1
Many jobs can read at same time.
2
Many jobs can read, only one can write.
3
Many jobs can read, many jobs can update, you are on your own regarding data
integrity.
4
Many jobs can read, many jobs can update.
system means roughly this MVS
3
Many jobs can read, many jobs can update, you are on your own regarding data
integrity.

B-6

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Many jobs can read, many jobs can update.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//*
DEFINE A VSAM ESDS
//DEFESDS EXEC PGM=IDCAMS
//SYSPRINT DD
SYSOUT=*
//SYSIN
DD
*
DELETE (userid.VSAM.ESDS) CLUSTER
DEFINE CLUSTER +
NAME(userid.VSAM.ESDS) CYLINDERS(1,1)
RECORDSIZE(80,80)
NONINDEXED)

//*
DEFINE A VSAM RRDS
//DEFRRDS EXEC PGM=IDCAMS
//SYSPRINT DD
SYSOUT=*
//SYSIN
DD
*
DELETE (userid.VSAM.RRDS) CLUSTER
DEFINE CLUSTER
NAME(userid.VSAM.RRDS) CYLINDERS(1,1)
RECORDSIZE(80,80)
NUMBERED)
/*

cl

//* LOAD A VSAM DATASET (KSDS, ESDS, RRDS) THEN PRINT IT


//LOADVSAM EXEC PGM=IDCAMS
//SYSPRINT DD
SYSOUT=*
//SYSIN
DD
*
REPRO INFILE(INDD) OUTDATASET(userid.VSAM.xxxx)
PRINT INDATASET(userid.VSAM.xxxx) CHARACTER

Ex

AP

for KSDS, records must be in order

pr

/*
//INDD DD *
ELENA
LINDA
NADIA
SUSAN
/*

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-7

Student Exercises

Examples of IDCAMS to Print


General JCL to print a file (sequential, VSAM, PDS member)

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//STEP1 EXEC PGM=IDCAMS


//SYSPRINT DD SYSOUT=*
//INFILE
DD DSN=name of file to be printed,DISP=SHR
//SYSIN
DD *
PRINT INFILE(INFILE) CHARACTER
/*

Example of JCL to print the file ABCCO.TEST.DATA (could be sequential, VSAM,


PDS member)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INFILE
DD DSN=ABCCO.TEST.DATA,DISP=SHR
//SYSIN DD *
PRINT INFILE(INFILE) CHARACTER
/*

pr

Ex

cl

Notes:change CHARACTER to DUMP in order to print in both character and hex


Change CHARACTER to HEX in order to print in hex

B-8

z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Examples of IDCAMS to copy


General JCL to copy a file (sequential, VSAM, PDS member)
to an existing file (sequential, VSAM, PDS member)

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//STEP1 EXEC PGM=IDCAMS


//SYSPRINT DD SYSOUT=*
//INFILE
DD DSN=name of file to be copied,DISP=SHR
//SYSIN DD *
REPRO INFILE(INFILE) OUTFILE(OUTFILE)
/*
//OUTFILE
DD DSN=name of file to be replaced,DISP=SHR

Example of JCL to copy the file ABCCO.TEST.DATA (could be sequential, VSAM,


PDS member) to the existing file ABCCO.SAMPLE.DATA
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INFILE
DD DSN=ABCCO.TEST.DATA,DISP=SHR
//SYSIN DD *
REPRO INFILE(INFILE) OUTFILE(OUTFILE)
/*
//OUTFILE
DD DSN=ABCCO.SAMPLE.DATA,DISP=SHR

cl

Notes:
IDCAMS will copy any of the following types:
Sequential
PDS member
VSAM
ISAM
to any of the following:
Sequential
PDS member
VSAM
ISAM
This JCL will clobber any data that already exists in the output file.
However, if the output file is VSAM and you want to clobber it, you must add
the keyword REUSE, for example:
REPRO INFILE(INFILE) OUTFILE(OUTFILE) REUSE
and you must have defined the VSAM cluster with REUSE.

pr

Ex

AP

Using IDCAMS to delete a file. If the file is not found,


Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-9

Student Exercises

there will be an error message and high return code.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* delete with idcams


//DELETE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
DELETE
dataset-name

Using IDCAMS to shorten a file by copying it with the skip or count


parameter.

pr

Ex

cl

//* shorten a file


//SHORT01 EXEC PGM=IDCAMS
//SYSPRINT DD
SYSOUT=*
//SYSIN
DD
*
REPRO INFILE(INDD) OUTFILE(OUTDD) SKIP(0001000) COUNT(0001000)
/*
//INDD
DD DSN=input-file,DISP=OLD
//OUTDD DD DSN=output-file,
//
DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(5,2),RLSE),
//
DCB=(RECFM=FB,LRECL=xx)
//*

B-10 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Examples of Running TSO in batch, running REXX


You can execute TSO commands, CLISTS, REXX programs.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* Run TSO in batch


//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200
//SYSPROC DD
DSN=your-id.clist,DISP=SHR optional
//SYSPRINT DD
SYSOUT=*
//SYSTSPRT DD
SYSOUT=*
//SYSTSIN DD *
PROFILE PREFIX(your-id)
LISTCAT LEVEL(your-id)
/*

Using TSO in batch to delete a file.

cl

//* Run TSO in batch


//* also IKEFFT01, IKJEFT1B
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200
//SYSPRINT DD
SYSOUT=*
//SYSTSPRT DD
SYSOUT=*
//SYSTSIN DD *
PROFILE PREFIX(your-id)
DELETE dataset-name

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-11

Student Exercises

Running a REXX program in batch


Obtain the name of your REXX library and fill it in.
If your REXX program reads a file, you can put in a DD for
the file and avoid having to do an ALLOC in the program.

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//RUNREXX EXEC PGM=IKJEFT1A,DYNAMNBR=200


//SYSEXEC DD
DSN=dsn-of-rexx-library,DISP=SHR
//INFILE
DD
DISP=SHR,DSN=dsn-of-input-file
//SYSPRINT DD
SYSOUT=*
//SYSTSPRT DD
SYSOUT=*
//*
//SYSTSIN DD *
PROFILE PREFIX(O054)
%MYREXX

B-12 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

Examples of ISPF Compare in batch

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//*SPF compare in batch


//SUPER1 EXEC PGM=ISRSUPC,
//
PARM=(DELTAL,LINECMP,'','')
//OLDDD DD DSN=old-dataset,
//
DISP=SHR
//NEWDD DD DSN=new-dataset,
//
DISP=SHR
//OUTDD DD SYSOUT=*
//*

The ISPF Search. Lower overhead, wont tie up your terminal during search.

cl

//* spf search option 3.14


//SEARCH EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'ANYC')
//NEWDD DD DSN=library-to-be-searched,
//
DISP=SHR
//OUTDD DD SYSOUT=*
//SYSIN DD *
SRCHFOR 'character-string-to-be-searched-for'
SELECT MEMBER1,MEMBER2
optional select. restricts search to these members
SELECT MEMBER3,MEMBER4
/*

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-13

Student Exercises

Example of a Safe Compress


The worlds safest compress for PDSs. Cant destroy your library. Creates a
backup first. If the compress works, it deletes the backup.
If the compress fails, it keeps the backup.

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* the ultimate batch compress


//* creates a backup library first.
//* then deletes the backup last, if all worked
//ERASE
EXEC PGM=IEFBR14
//OUTPDS
DD DSN=your-id.name-of-backup-lib,DISP=(MOD,DELETE),
//
UNIT=SYSDA,SPACE=(TRK,0)
//*
//COPY
EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
COPY INDD=INPDS,OUTDD=OUTPDS
/*
//INPDS
DD DSN=library-to-be-compressed,DISP=SHR
//OUTPDS
DD DSN=your-id.name-of-backup-lib,REFDD=*.INPDS,
//
UNIT=SYSDA, or your disk unit,
//
DISP=(NEW,CATLG,DELETE),
//
SPACE=(TRK,(100,10,50),RLSE)
//*
//* produce jcl error if the previous step failed
//JCLOUT
EXEC PGM=IEFBR14,COND=(0,EQ,COPY)
//DD1
DD
DSN=NOT.THERE,DISP=SHR
//*
//* this will do the compress
//COMPRESS EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
COPY INDD=INPDS,OUTDD=INPDS
/*
//INPDS
DD DSN=library-to-be-compressed,DISP=SHR
//*
//* if compress fails, send tso message
//
IF (RC GT 0) THEN
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200,COND=(0,LT)
//SYSPRINT DD
SYSOUT=*
//SYSTSPRT DD
SYSOUT=*
//SYSTSIN DD *
PROFILE PREFIX(your-id)
SEND 'COMPRESS FAILED library-to-be-compressed' USER(your-id) LOGON WAIT
B-14 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//
ELSE
//ERASE
EXEC PGM=IEFBR14,COND=(0,LE)
//OUTPDS
DD DSN=your-id.name-of-backup-lib,DISP=(MOD,DELETE),
//
UNIT=SYSDA,SPACE=(TRK,0)
//
ENDIF

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-15

Student Exercises

Example of Copying a PDS

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* COPY ONE PDS TO ANOTHER DO NOT REPLACE LIKE-NAMED MEMBERS


//LIBCOPY EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//SYSUT2
DD UNIT=SYSDA,SPACE=(CYL,(3,3))
//SYSUT3
DD UNIT=SYSDA,SPACE=(CYL,(3,3))
//SYSUT4
DD UNIT=SYSDA,SPACE=(CYL,(3,3))
//INLIB
DD DSN=library-containing-members,DISP=SHR
//OUTLIB
DD DSN=library-to-put-members-in,DISP=SHR
//SYSIN
DD *
COPY INDD=INLIB,OUTDD=OUTLIB
/*
//* OPTIONAL THINGS:
//*
//* TO COPY BUT EXCLUDE TWO MEMBERS:
//* COPY INDD=INLIB,OUTDD=OUTLIB
//* EXCLUDE MEMBER=(m1,m2)
//*
//* TO COPY AND REPLACE:
//* COPY INDD=((INLIB,R)),OUTDD=OUTLIB

pr

Ex

cl

//*iebcopy to copy a pds


//*in: pds
//*out: pds
//*copy only members named MEM1 and MEM2
//*do not replace those members if they exist in the output pds
//IEBCOPY
EXEC PGM=IEBCOPY
//SYSPRINT DD
SYSOUT=*
//SYSIN
DD
*
COPY INDD=(INPDS),OUTDD=OUTPDS
SELECT MEMBER=MEM1
SELECT MEMBER=MEM2
/*
//*
//*
//*
//*iebcopy to copy a pds
//*in: pds
//*out: pds
//*copy only members named MEM1 and MEM2
//*replace those members if they exist in the output pds
//IEBCOPY
EXEC PGM=IEBCOPY
//SYSPRINT DD
SYSOUT=*
B-16 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//SYSIN
DD
*
COPY INDD=((INPDS,R)),OUTDD=OUTPDS
SELECT MEMBER=MEM1
SELECT MEMBER=MEM2
/*

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-17

Student Exercises

IEFBR14
Using IEFBR14 to delete a file. If the file is not found,
there will be no error message and no high return code.
EXEC PGM=IEFBR14
DD DSN=your-id.name-of-backup-lib,DISP=(MOD,DELETE),
UNIT=SYSDA,SPACE=(TRK,0)

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//ERASE
//OUTPDS
//
//*

Using IEFBR14 to avoid deleting and reallocating a file.


If you run a job frequently, and it needs the same
output dataset each time, you can use this JCL.

It finds the dataset, if it already exists.


Then it clobbers it, avoiding the overhead of reallocating.
Note that the disposition on the step that actually uses
the file, later in the job, must be (OLD,CATLG)
If the dataset doesn't exist, it is created.

EXEC PGM=IEFBR14
DD
DSN=dsn-to-be-used-later-in-job,
UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(MOD,PASS),
LRECL=133,RECFM=FB,BLKSIZE=27930

pr

Ex

cl

//FINDPASS
//DD1
//
//
//*

B-18 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

SORT Examples

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* to sort
//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
* sort by name
SORT FIELDS=(10,9,CH,A),DYNALLOC=(SYSDA,6),FILSZ=E2000
/*
//* END OF JOB

cl

//* sort and do totals


//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
* sort by state
* sum phone number
SORT FIELDS=(19,2,CH,A),DYNALLOC=(SYSDA,6),FILSZ=E2000
SUM FIELDS=(1,7,ZD)
* ZD is zoned decimal. signed or unsigned
* PD packed decimal. BI Binary
/*
//* END OF JOB

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-19

Student Exercises

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* to sort and shift fields


//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD * number in column 1, name in 10, state in 19
* sort by name (name is now in 1)
SORT FIELDS=(01,09,CH,A),DYNALLOC=(SYSDA,6),FILSZ=E2000
INREC FIELDS=(01:10,09,
move name from 10 to 1
10:01,07)
move number from 1 to 10
* inrec moves data before sorting starts
/*
//* END OF JOB

pr

Ex

cl

//* to sort and shift fields


//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD *
number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
* sort by name
SORT
FIELDS=(10,09,CH,A),DYNALLOC=(SYSDA,6),FILSZ=E2000
OUTREC FIELDS=(01:10,09,
move name from 10 to 1
10:01,07)
move number from 1 to 10
* outrec moves data after sorting ends
/*
//* END OF JOB

//* PLAIN COPY


//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19

B-20 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
SORT FIELDS=COPY
/*
//* END OF JOB

//*
COPY BUT SKIP 3 RECORDS
//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
SORT FIELDS=COPY,SKIPREC=3
/*

cl

//*
COPY. START WITH 4TH RECORD. STOP AFTER PRINTING 2 RECORDS
//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
SORT FIELDS=COPY,SKIPREC=3,STOPAFT=2 STOP AFTER PRINTING 2
/*

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-21

Student Exercises

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* COPY BUT ONLY IF LITERAL CT IS IN COLUMN 19 OF DATA


//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
SORT FIELDS=COPY
COPY BUT
INCLUDE COND=(19,2,CH,EQ,C'CT') ONLY IF CT IN COL 19
/*

pr

Ex

cl

//*
COPY BUT NOT IF LITERAL CT IS IN COLUMN 19 OF INPUT
//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
SORT FIELDS=COPY
COPY BUT
OMIT
COND=(19,2,CH,EQ,C'CT') NOT IF CT IN COL 19
/*

//* COPY. INCLUDE RECORDS WITH LITERAL CT IN COLUMN 19,


//*
OR LITERAL J IN COLUMN 10
//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*

B-22 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//SORTIN DD * number in column 1, name in 10, state in 19


9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
SORT FIELDS=COPY
USING AN OR
*
COPY IF CT IN COL 19
*
OR J IN COL 10
INCLUDE COND=(19,2,CH,EQ,C'CT',OR,10,1,CH,EQ,C'J')
* AND WORKS TOO. ALSO X'C1' FOR A
/*

cl

//* COPY INPUT FILE TO OUTPUT FILE BUT MOVE AS FOLLOWS


//* PUT THIS IN OUTPUT COLUMN 20: 9 CHARACTERS STARTING IN COLUMN 1
//*
COLUMN 40: 16 CHARACTERS STARTING IN COLUMN 10
//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
* COPY INPUT FILE TO OUTPUT FILE BUT MOVE AS FOLLOWS
* PUT THIS IN OUTPUT COLUMN 20: 9 CHARACTERS STARTING IN COLUMN 1
*
COLUMN 40: 16 CHARACTERS STARTING IN COLUMN 10
SORT FIELDS=COPY
INREC FIELDS=(20:1,09,40:10,16)
/*

pr

Ex

AP

//* COPY INPUT FILE TO OUTPUT FILE BUT MOVE AS FOLLOWS


//* PUT THIS IN OUTPUT COLUMN 20: 9 CHARACTERS STARTING IN COLUMN 1
//*
COLUMN 40: 16 CHARACTERS STARTING IN COLUMN 10

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-23

Student Exercises

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//* include only records from CT


//SORTIT EXEC PGM=SORT,PARM=ABEND
//SYSOUT DD SYSOUT=*
//SORTIN DD * number in column 1, name in 10, state in 19
9283873 JOAN
CT
7023232 JANE
CN
8432343 MARIO
MA
5549023 JILL
CT
6998781 JENNIFER VT
8432343 MURIEL
RI
/*
//SORTOUT DD SYSOUT=*
//SYSIN
DD *
* COPY INPUT FILE TO OUTPUT FILE BUT MOVE AS FOLLOWS
* PUT THIS IN OUTPUT COLUMN 20: 9 CHARACTERS STARTING IN COLUMN 1
*
COLUMN 40: 16 CHARACTERS STARTING IN COLUMN 10
SORT FIELDS=COPY
INREC FIELDS=(20:1,09,40:10,16)
INCLUDE COND=(19,2,CH,EQ,C'CT') only if CT in column 19
* include condition looks at input columns before INREC or OUTREC work
/*

pr

Ex

cl

//*
//*syncsort to eliminate duplicates
//* in: seq
//* out: seq
//SYNCSORT EXEC PGM=SYNCSORT
//SYSOUT
DD
SYSOUT=*
//SORTIN
DD
DISP=SHR,
<-the input
//
DSN=the.input.dsn
//SORTOUT DD
DISP=(NEW,CATLG), <-the output
//
UNIT=SYSDA,LIKE=the.input.dsn,
//
SPACE=(TRK,(1,1),RLSE)
//SYSIN
DD *
SORT FIELDS=(1,80,CH,A)
SUM FIELDS=NONE
/*
//*
//*
//*
//*syncsort to include records on a condition
//*uses OUTREC to construct the output record

B-24 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

V8.0
Student Exercises

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

//*from fields on the input record


//* in: seq
//* out: seq
//SYNCSORT EXEC PGM=SYNCSORT
//SYSOUT
DD
SYSOUT=*
//SORTIN
DD
DISP=SHR,
<-the input
//
DSN=the.input.dsn
//SORTOUT DD
DISP=(NEW,CATLG), <-the output
//
UNIT=SYSDA,LIKE=the.input.dsn,
//
SPACE=(TRK,(1,1),RLSE)
//SYSIN
DD *
SORT FIELDS=(1,80,CH,A)
INCLUDE COND=((51,7,CH,EQ,C'STRING1'),OR,
(51,7,CH,EQ,C'STRING2'))
OUTREC FIELDS=(01:11,08,
20:51,19)
* a literal may be used in the outrec:
* OUTREC FIELDS=(C'!',
*
20:C'ABCD')
SUM FIELDS=NONE
/*
//*
//*

pr

Ex

AP

Copyright IBM Corp. 2001, 2013

Appendix B. JCL: Examples

Course materials may not be reproduced in whole or in part


without the prior written permission of IBM.

B-25

pr

Ex

cl

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

Student Exercises

B-26 z/OS Fundamentals

Copyright IBM Corp. 2001, 2013


Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

backpg

pr

cl

Ex
V8.0

Back page

pr

u
oy si
ec vo
to fo
C rm
.F a
.T ci
.I. n
C
.

cl

Ex

CONTACTO
Telfono
91 761 21 78
Pngase en contacto con nuestro equipo y le
informaremos de cualquier duda o cuestin
que pueda surgirle.

Email
formacion@arrowecs.es
Mndenos un email y le atenderemos
enseguida.

Online
@Arrow_Edu_ES
O bien puede contactarnos a travs de
nuestro perfil en Twitter.

Vistenos
Arrow ECS Education Services
Avenida de Europa 21,
Parque Empresarial La Moraleja
28108 Alcobendas, Madrid

EDUCATION
S

Вам также может понравиться