Introduction to the new mainframe
Chapter 6: Using Job Control Language (JCL) and
System Display and Search Facility (SDSF)
Copyright IBM Corp., 2006. All rights reserved. py g p , g
Introduction to the new mainframe
Chapter 6 objectives
Be able to:
Explain how JCL works with the system,
give an overview of JCL coding give an overview of JCL coding
techniques, and know a few of the more
important statements and keywords
C t i l j b d b it it f Create a simple job and submit it for
execution
Check the output of your job through p y j g
SDSF
Copyright IBM Corp., 2006. All rights reserved.
2
Introduction to the new mainframe
Key terms in this chapter
t ti d f t (RECFM) concatenation
DD statement
Job Control Language (JCL)
record format (RECFM)
system display and search
facility (SDSF)
g g ( )
JOB statement
EXEC statement
job name
step name
system catalog
system library
job name
procedure (PROC)
system library
utility
Copyright IBM Corp., 2006. All rights reserved.
3
Introduction to the new mainframe
What is JCL?
Job control language (JCL) tells the system what program
to execute and provides a description of program inputs
and outputs and outputs.
There are three basic JCL statements:
JOB statement JOB statement
EXEC statement
DD statement
Copyright IBM Corp., 2006. All rights reserved.
4
Introduction to the new mainframe
Basic JCL coding syntax
JCL must be uppercase
Forward slash in column 1 and 2
JCL must be uppercase
Name (1 8 characters) follow the slashes Name (1-8 characters) follow the slashes
Space separators
//JOBNAME JOB
//STEPNAME EXEC
//DDNAME DD
//* comment - upper or lower case pp
/* ....end of JCL stream
Copyright IBM Corp., 2006. All rights reserved.
5
Introduction to the new mainframe
JCL example
//MYJOB JOB 1 MSGCLASS T //MYJOB JOB 1,MSGCLASS=T
//MYSORT EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=[Link]
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD * //SYSIN DD *
SORT FIELDS=(1,3,CH,A)
/*
Copyright IBM Corp., 2006. All rights reserved.
6
Introduction to the new mainframe
In the preceding example
MYJOB Job name
MYSORT Step name
SORTIN DD name for program input
SORTOUT DD name for program output
SYSOUT Where to send system output
messages (such as a data set)
SYSIN S ifi h h h i ill SYSIN Specifies whether the input will
be data or control statements.
Copyright IBM Corp., 2006. All rights reserved.
7
Introduction to the new mainframe
JCL: JOB statement
Create a member using ISPF edit Create a member using ISPF edit
Create JCL statements
JOB statement
Accounting information
Execution classes
Copyright IBM Corp., 2006. All rights reserved.
8
Introduction to the new mainframe
JCL: EXEC statement
EXEC statement
Region size Region size
Copyright IBM Corp., 2006. All rights reserved.
9
Introduction to the new mainframe
JCL: DD statement
DD statement
DD name (referenced in the program)
DSN= (the data set name as cataloged on disk)
Copyright IBM Corp., 2006. All rights reserved.
10
Introduction to the new mainframe
Specifying a data set disposition:
DISP is an operand of the DD statement
DISP indicates what to do with the data set (the
di iti ) t t t t d b l d (if th j b disposition) at step start, end, or abnormal end (if the job
fails)
DISP helps to prevent unwanted simultaneous access to DISP helps to prevent unwanted simultaneous access to
data sets, which is very important for general system
operation. ope at o
Copyright IBM Corp., 2006. All rights reserved.
11
Introduction to the new mainframe
Uses of the DISP= operand
DISP=(status,normal end,abnormal end)
DISP=(status,normal end)
DISP=status
where status can be where status can be
NEW
OLD
SHR SHR
MOD
Copyright IBM Corp., 2006. All rights reserved.
12
Introduction to the new mainframe
Creating a new data set
New data sets can be created through JCL by using the
DISP=NEW parameter.
F DISP NEW t d t l For a DISP=NEW request, you need to supply more
information, including:
A data set name DSN= A data set name, DSN=
The type of device for the data set, UNIT=sysda
If a disk is used, the amount of space to be allocated for the
primary extent must be specified, SPACE=
If it is a partitioned data set, the size of the directory must be
specified within the SPACE parameter specified within the SPACE parameter
Optionally, DCB parameters can be specified.
Copyright IBM Corp., 2006. All rights reserved.
13
Introduction to the new mainframe
Continuation and concatenation
Needed to overcome the limitations of the 80-column
punched cards used in earlier systems.
Continuation allows a JCL statement to span multiple records Continuation allows a JCL statement to span multiple records.
Concatenation allows a single ddname to have multiple DD
statements.
Copyright IBM Corp., 2006. All rights reserved.
14
Introduction to the new mainframe
Continuation and concatenation (example)
C i i l Continuation example
//JOBCARD JOB 1,
// REGION=8M, // REGION 8M,
// NOTIFY=IBMUSER
Concatenation example
//DATAIN DD DISP=OLD,DSN=MY.INPUT1
// DD DISP=OLD,DSN=MY.INPUT2
// DD DISP SHR DSN YOUR DATA // DD DISP=SHR,DSN=[Link]
Copyright IBM Corp., 2006. All rights reserved.
15
Introduction to the new mainframe
JCL procedures - example
//MYJOB JOB 1 //MYJOB JOB 1
//MYPROC PROC
//MYSORT EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=&SORTDSN
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=* //SYSOUT DD SYSOUT=*
// PEND
Copyright IBM Corp., 2006. All rights reserved.
16
Introduction to the new mainframe
JCL procedures (continued)
//MYJOB JOB 1 //MYJOB JOB 1
//*---------------------------------*
//MYPROC PROC
//MYSORT EXEC PGM=SORT //MYSORT EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=&SORTDSN
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=* //
// PEND
//*---------------------------------*
//STEP1 EXEC MYPROC,SORTDSN=[Link]
//SYSIN DD *
SORT FIELDS=(1,3,CH,A)
Copyright IBM Corp., 2006. All rights reserved.
17
Introduction to the new mainframe
JCL procedures -- statement override
//MYJOB JOB 1
//*---------------------------------*
//MYPROC PROC
//MYSORT EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=&SORTDSN
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
// // PEND
//*---------------------------------*
//STEP1 EXEC MYPROC,SORTDSN=[Link]
//MYSORT SORTOUT DD DSN IBMUSER MYSORT OUTPUT //[Link] DD DSN=[Link],
// DISP=(NEW,CATLG),SPACE=(CYL,(1,1)),
// UNIT=SYSDA,VOL=SER=SHARED,
// DCB=(LRECL=20 BLKSIZE=0 RECFM=FB DSORG=PS) // DCB=(LRECL=20,BLKSIZE=0,RECFM=FB,DSORG=PS)
//SYSIN DD *
SORT FIELDS=(1,3,CH,A)
Copyright IBM Corp., 2006. All rights reserved.
18
Introduction to the new mainframe
Using SDSF
Af b i i j b /OS S Di l d S h After submitting a job, z/OS users use System Display and Search
Facility (SDSF) to review the job output for successful completion
or JCL errors.
SDSF allows users to:
Vi d h th t l View and search the system log
Enter system commands
Hold, release, cancel, and purge jobs
Monitor jobs while they are processed
Display job output before deciding to print it
Control the order in which jobs are processed Control the order in which jobs are processed
Control the order in which output is printed
Control printers and initiators
Copyright IBM Corp., 2006. All rights reserved.
19
Introduction to the new mainframe
SDSF panel hierarchy
Primary
Option
Menu Menu
SYSLOG
Display
A ti
Input Output
Help
O t t St t P i t I iti t SYSLOG
Panel
Active
Users
Panel
Input
Queue
Panel
Output
Queue
Panel
Output
Queue
Panel
Status
Panel
Printer
Panel
Initiator
Panel
Job
Data Set
Panel
Output
Descriptor
Panel Panel Panel
Output
Copyright IBM Corp., 2006. All rights reserved.
20
p
Data Set
Panel
Introduction to the new mainframe
SDSF: Primary option menu
Copyright IBM Corp., 2006. All rights reserved.
21
Introduction to the new mainframe
SDSF: Options menu
Copyright IBM Corp., 2006. All rights reserved.
22
Introduction to the new mainframe
Viewing the JES2 output files
Screen 1 Screen 1
Screen 2
Copyright IBM Corp., 2006. All rights reserved.
23
Introduction to the new mainframe
SDSF: Display active users (DA)
Copyright IBM Corp., 2006. All rights reserved.
24
Introduction to the new mainframe
Issuing MVS and JES commands
Copyright IBM Corp., 2006. All rights reserved.
25
Introduction to the new mainframe
SDSF: Input queue panel
Copyright IBM Corp., 2006. All rights reserved.
26
Introduction to the new mainframe
SDSF: Output queue panel
Copyright IBM Corp., 2006. All rights reserved.
27
Introduction to the new mainframe
SDSF: Held output queue panel
Copyright IBM Corp., 2006. All rights reserved.
28
Introduction to the new mainframe
SDSF: Status panel
Copyright IBM Corp., 2006. All rights reserved.
29
Introduction to the new mainframe
Utilities
/OS i l d b f f l i b h i z/OS includes a number of programs useful in batch processing
called utilities.
Utilities provide many small, obvious, and useful functions. p y , ,
A basic set of system-provided utilities is described in the
textbook (Appendix C).
C t it ft it th i tilit f Customer sites often write their own utility programs, many of
which are shared by the z/OS user community.
Some examples of utilities: p
o IEBGENER Copies a sequential data set
o IEBCOPY Copies a partitioned data set
o IDCAMS Works ith VSAM data sets o IDCAMS Works with VSAM data sets
Copyright IBM Corp., 2006. All rights reserved.
30
Introduction to the new mainframe
System Libraries
z/OS has many standard system libraries, including:
[Link] JCL procedures distributed
with z/OS
[Link] Control parameters for z/OS S S Co t o pa a ete s o /OS
and some program products.
[Link] Many of the basic execution
modules of the system modules of the system.
[Link] System execution modules
that are loaded into the link
pack area at z/OS initialization.
Copyright IBM Corp., 2006. All rights reserved.
31
Introduction to the new mainframe
Summary
B i JCL i h JOB EXEC d DD Basic JCL contains three statements: JOB, EXEC, and DD.
A program can access different groups of data sets in different
jobs by changing the JCL for each job. j y g g j
New data sets can be created through JCL by using the
DISP=NEW parameter.
U ll JCL d f l j b A Users normally use JCL procedures for more complex jobs. A
cataloged procedure is written once and can then be used by
many users.
z/OS supplies many JCL procedures, and locally-written ones
can be added easily.
A user must understand how to override or extend statements in A user must understand how to override or extend statements in
a JCL procedure to supply the parameters (usually DD
statements) needed for a specific job.
Copyright IBM Corp., 2006. All rights reserved.
32
Introduction to the new mainframe
Summary - continued
SDSF i l i f f i i h l d h li SDSF is a panel interface for viewing the system log and the list
of active users and controlling and monitoring jobs and
resources.
Utility programs make operating on data sets easier
System libraries contain JCL procedures, control parameters,
and system execution modules and system execution modules.
Copyright IBM Corp., 2006. All rights reserved.
33