Sie sind auf Seite 1von 14

JCL

You may sometimes want to test a programs logic without actually processing any
data. To do this, you can create dummy data sets.When you have finished testing, you
can replace the dummy definition with one that defines the data set fully. Device
allocation, space allocation, disposition, and all I/O operations are ignored with dummy
data sets. If you try to read data from a dummy data set, MVS returns an end-of-file
condition. Any attempts to write data to a dummy data set are simply ignored. You can
assign dummy status to a data set in two ways. The first way is to code the optional
DUMMY parameter of the DD statement. The DUMMY parameter is positional and,
when used, must always be coded in the first position. The second way to assign dummy
status is to code DSNAME=NULLFILE or DSN=NULLFILE.

Because no I/O is performed, if you code these parameters for a dummy data set,
MVS checks their syntax but otherwise ignores them. However, you may find it useful to
code all DD parameters as normal. If you code all DD parameters as normal, you can
fully utilize the data set later by simply removing its dummy status. For example, you can
utilize a dummy data set coded with DSN=NULLFILE by replacing NULLFILE with the
ddname. Even though you can decide not to code any additional parameters for a dummy
data set, you need to code some when
it is referenced by an application program
it is a VSAM data set
When an application program specifies a block size for a data set, you code the
blocksize with DCB=BLKSIZE=<number>.When the program calls a VSAM data set,
you should specify the parameter AMP=AMORG in the DD statement.
Sometimes a data set is used within a job and then deleted at the end of that job.
Because these temporary data sets are deleted, the storage space they use is freed. You
can make a data set temporary in two ways. You can omit the DSN parameter completely,
meaning that the data set has no name. If you omit the DSN parameter, MVS assigns its
own name to the data set.
You can still reference the data set using the name of the DD statement. The
second way to give a data set temporary status is to code
DSN=&&<name>
The ampersands (&&) identify the data set as temporary. You can reference the
data set using the name you coded. You can specify single-step or multistep temporary
data sets. If you are using a temporary data set in a single job step, you specify
DISP=(NEW,DELETE).
Some temporary data sets are used by more than one job step. The method used
for sharing data between steps is called pass and receive. When a data set is ^Rpassed^r,

it is retained for use by a subsequent job step. The data set is retained in storage, although
it can also be cataloged in a library. When a data set is received, it is allocated for use by
a subsequent job step.
This sample code shows how you might code the DISP parameter in three
different job steps that use the same temporary data set.
|
In the first step, the temporary data set TEMPA5 is created and passed for subsequent
use.
|
The use of ampersands (&&) in the DSN parameter indicate that it is temporary.
|
Its disposition is NEW, and it is passed for use by a subsequent job step.
|
In the second step, the data sets disposition is OLD, and it is passed again.
|
In the third step, it is deleted.
|
The MVS Virtual Input/Output (VIO) facility allows you to store temporary data sets
entirely in virtual storage.
|
These VIO temporary data sets can be accessed faster than data sets that reside on
DASDs.
|
VIO data sets cannot be kept at the end of a job, so the DISP parameter can never be
DISP=CATLG or DISP=KEEP.
|
To use a VIO data set, you must specify a storage class using the STORCLAS parameter.
|
Storage classes are defined at installation level.
|
You can also code the DCB, SPACE, and DSN parameters.
|
The SPACE parameter has a default, ^RSPACE=(8192,(4,24))^r.
And the DSN parameter must follow the temporary data set naming conventions.
|
You do not code the VOL=SER parameter.
|
The code for a multistep VIO temporary data set might look like this.
|
A VIO data set cannot be a VSAM, extended sequential, or extended partitioned data set.
|
VIO data sets have a maximum size of 65,535 tracks.
@@
Before you create a data set on a DASD, you need to reserve disk space.

|
When you request space on a particular volume, the system checks the Volume Table of
Contents (VTOC) to determine whether that space is available in contiguous tracks.
|
Contiguous tracks are tracks on the same cylinder.
|
If contiguous space is available, it is allocated and the VTOC is updated.
|
If contiguous space is not available, the system will resort to using noncontiguous areas.
|
If the system cannot allocate the space you request, either contiguously or
noncontiguously, it will search on another volume.
|
Space allocation does not apply to tape volumes.
|
You reserve disk space in two separate amounts:
the primary amount
|
the secondary amount
|
A unit of allocated space, either a primary or secondary amount, or the space allocated for
a label, is known as an ^Rextent^r.
|
The primary amount is allocated when a data set with a disposition of NEW or MOD is
created.
|
The primary amount is always allocated on a single volume.
|
If the primary amount is not available on a volume that you have specified, the job step is
terminated.
|
It is often difficult to know exactly how much space a data set will require.
|
In such a case, you should try to estimate the primary amount as accurately as possible.
|
Typically, you will find you need the secondary amount.
|
The secondary amount is allocated only if the primary amount proves too small to hold
the data generated by the job.
|
If there still isn't enough space, more secondary space is allocated.
|
Since only a finite number of secondary allocations can occur, it's best to define the
primary allocation large enough to hold the entire dataset.

There can be performance issues when a dataset goes into extents.


@@
You allocate space using the DD statement's SPACE parameter.
|
It's a keyword parameter and takes this format.
|
The first subparameter of the SPACE parameter indicates which unit of space is in
question, while the second and third subparameters specify the primary and secondary
amounts to be allocated.
|
You can allocate space in terms of
cylinders
|
tracks
|
blocks
|
If Storage Management Subsystem (SMS) is active, you can simplify the SPACE
parameter by using the AVGREC parameter to specify the average record length of your
data.
|
SMS is an optional MVS component that manages disk data sets.
|
To allocate space in units of cylinders, you code ^RCYL^r as the first subparameter.
|
To allocate space in tracks, you code ^RTRK^r.
|
If you want to allocate space in terms of blocks, you must tell MVS how big each block
should be.
|
You express this as a decimal value in the first subparameter.
|
It can be quite awkward to allocate space in terms of tracks.
|
The number of records that fits on a particular track depends on the BLKSIZE and
LRECL you specify in the DD statement, as well as the type of disk unit you're using.
|
Allocating space in terms of cylinders has the advantage of reducing disk arm movement.
|
But, like track allocation, it is device-specific.
@@
If you allocate space in blocks, rather than tracks or cylinders, you can at least estimate
how much space you need regardless of device type.
|
Let's look at some examples of space allocation using the SPACE parameter.

|
In this example, space is allocated in cylinders.
|
The primary allocation is 50 cylinders.
|
And the secondary allocation is 10 cylinders.
|
In this example, space is allocated in tracks.
|
The primary allocation is 20 tracks.
|
And the secondary allocation is 4 tracks.
|
Here space is allocated in 800-byte blocks.
|
The primary amount is 50 blocks.
|
There is no secondary amount specified.
|
If you code the SPACE parameter on a DD statement that relates to an existing data set,
this overrides the original space allocation.
|
When you create a PDS, you need to request space for the directory that holds the names
of the PDS members.
|
The fourth subparameter of the SPACE parameter tells the system how large this
directory should be.
|
It is used only in relation to PDSs.
|
The directory subparameter ignores the unit of allocation you specified in the first
subparameter.
|
It allocates the directory space in ^Rdirectory blocks^r, each of which consists of 256
bytes.
|
A directory block can hold, on average, five member names.
|
This example shows a typical SPACE parameter for a PDS.
|
Space is allocated in cylinders, five for the primary amount and one for the secondary
amount.
|
Two directory blocks have been allocated - enough to hold around ten member names.
@@

The SPACE parameter has a number of useful subparameters that allow you to optimize
your use of disk space.
|
Here is the full syntax of the SPACE parameter.
|
Note that CONTIG, MXIG, and ALX are mutually exclusive.
|
And all the subparameters are positional.
|
The ^RRLSE^r subparameter frees up any space that remains unused after data has been
written.
|
The system releases space only if the relevant data set contains data, and has been closed.
|
If you code the RLSE subparameter, you can be generous when estimating how much
space a data set will need.
|
In this example, 20 tracks have been allocated as the primary amount, and 4 tracks as the
secondary amount.
|
Because RLSE has been coded, any unused space will be released after the data set has
been written.
|
If the system allocates an extent that it doesn't fill, the empty space is released along with
the space in completely empty extents.
|
The RLSE subparameter is very useful, but it has disadvantages.
|
For example, if you expect your data set to grow at a later stage, you should not code
RLSE.
|
In addition, excessive use of the RLSE option contributes to disk fragmentation.
@@
The CONTIG, MXIG, and ALX subparameters are designed to maximize use of
contiguous disk space.
|
If you use contiguous disk space, you get faster access to your data.
|
When you specify ^RCONTIG^r, the system allocates the primary amount in a single
extent on contiguous tracks and cylinders.
|
If there is no extent large enough, the job step abends.
|
CONTIG applies to the primary amount only.
|

^RMXIG^r tells the system to allocate the largest available contiguous space, provided
that space is as large as - or larger than - the primary amount specified.
|
MXIG is used as an alternative to requesting a secondary allocation.
|
If you code ^RALX^r, the system allocates up to five extents, each of which is as large as
- or larger than - the primary amount.
|
As with MXIG, ALX is used in conjunction with large data sets, as an alternative to
requesting a secondary amount.
|
If you code MXIG or ALX, you may take up huge amounts of space unnecessarily.
|
So, if you decide to use one of these options, you should code RLSE as well.
|
You should never use MXIG or ALX with indexed sequential data sets.
|
The ^RROUND^r subparameter is used only when space is allocated in blocks.
|
It rounds the block allocation up to the nearest number of cylinders.
|
This ensures that the data starts on the first track of a cylinder and ends on the last track
of a cylinder.
|
This can result in faster disk access.
|
Let's look at some examples of the various SPACE subparameters in use.
|
In this example, the primary allocation of 100 cylinders must be made on contiguous
cylinders.
|
As you can see, the missing positional parameter - in this case RLSE - has been replaced
by a comma.
|
This code requests the largest available extent for the primary allocation.
|
The extent used must be at least 50 cylinders.
|
Here the space is allocated in 1024-byte blocks, rounded up to whole cylinders.
@@
Storage Management Subsystem (SMS) is an optional MVS component that manages
disk data sets.
|
SMS works by providing extra DD parameters for data set classification.
|
These parameters apply to new data sets only.

|
If coded for any other type of data set, they are ignored.
|
Some of the most important additional DD parameters available under SMS are
AVGREC
|
LIKE
|
SECMODEL
|
STORCLAS
|
DATACLAS
|
MGMTCLAS
|
The ^RAVGREC^r parameter is an SMS-specific extension to the SPACE parameter.
|
As you know, the SPACE parameter allows you to allocate space in terms of cylinders,
tracks, or blocks.
|
AVGREC also allows you to allocate space in terms of records.
|
To allocate space in terms of records, you code the first subparameter of the SPACE
parameter as a decimal value representing the average record size in bytes.
|
Normally, this value would be interpreted as block size.
|
So you must also code the AVGREC parameter to indicate that youre talking about
records, not blocks.
|
You can code the AVGREC parameter in three ways:
AVGREC=U
|
AVGREC=K
|
AVGREC=M
|
Each of these options represents a factor by which the primary and secondary amounts
are multiplied.
|
If you code AVGREC=U, the primary and secondary amounts are multiplied by 1, so they
effectively dont change.
|

If you code AVGREC=K, the factor is 1024.


|
Coding AVGREC=M multiplies the amounts by 1,048,576.
|
In this example, the average record size coded is 240 bytes.
|
Because you have coded AVGREC=K, the primary and secondary amounts are multiplied
by a factor of 1024.
|
So the primary allocation will be enough to store 4096 records, each 240 bytes in size.
|
And the secondary allocation will be able to hold 2048 records, each 240 bytes in size.
@@
You can use the ^RLIKE^r parameter to model a new data set on one that already exists.
|
The existing data set must be cataloged and it must reside on a DASD - but it does not
have to be managed by SMS.
|
When you use the LIKE parameter, the principal attributes copied from the existing data
set to the new one are
record format
|
record length
|
space allocation
|
In other words, the new data set duplicates the existing data sets RECFM, LRECL,
SPACE, and AVGREC parameters.
|
The KEYLEN and KEYOFF parameters are also copied for VSAM key-sequenced data
sets, and DSNTYPE is copied for PDS and PDSE data sets.
|
In this example, all the relevant characteristics of the existing data set
VJENKINS.JULY.SALES are duplicated in the new data set VJENKINS.AUG.SALES.
|
You can use the LIKE parameter to duplicate selected attributes of an existing data set.
|
To do this, you simply code the parameter that you don't want duplicated in the normal
way.
|
Here every relevant attribute of VJENKINS.JULY.SALES is copied, except the SPACE
parameter.
|
The new data set VJENKINS.AUG.SALES has its own space allocation.
|

The ^RSECMODEL ^rparameter is used in conjunction with RACF, the MVS security
component.
|
You use it to select a RACF data set profile other than the default.
|
A RACF data set profile controls access to that data set.
|
You can also use it to select a RACF profile when no default has been defined.
|
In this example, the data set is given the RACF profile SALES.PROF1.DATA.
@@
Although an installation may be running SMS, not every data set is managed by SMS.
|
Data sets managed by SMS have three ^Rclass values^r:
storage class
|
data class
|
management class
|
These class values have associated DD parameters - STORCLAS, DATACLAS, and
MGMTCLAS.
|
Some SMS installations have defaults known as automatic class selection^R
^r(^RACS^r)^R ^rroutines.
|
These determine how a data set is defined if STORCLAS, DATACLAS, or MGMTCLAS
are omitted.
|
The ^RSTORCLAS^r parameter identifies a data set as being managed by SMS.
|
It replaces the UNIT and VOLUME parameters used by non-SMS data sets.
|
Individual installations decide which volume and unit are associated with a particular
STORCLAS name.
|
The user then codes the STORCLAS parameter accordingly.
|
Suppose an installation has defined a storage class called "LIB02".
|
The storage class associates that name with a particular unit and volume.
|
This code ensures that the data set SMCCOY.INV.FG125 is stored in that location.
|
Now let's look at the ^RDATACLAS^r parameter.

|
Each installation associates a DATACLAS name with a particular configuration of
attributes.
|
<f>These attributes include data set organization, record length, space allocation, and
retention period.
|
You can then assign the attributes to a data set using the DATACLAS parameter.
|
Suppose an installation has defined a data class called "ACCIN".
|
It has these attributes:
RECFM=VB
|
LRECL=180
|
SPACE=(TRK,(100,10))
|
AVGREC=K
|
The code shown here applies each of these attributes to the data set
SMCCOY.INV.FG109.
|
The result is the same as if you had used this code.
|
You can override any of the attributes defined in the DATACLAS name by coding them
separately in the same DD statement.
|
^RMGMTCLAS^r differs from STORCLAS and DATACLAS in that it doesn't perform
the function of existing DD parameters.
|
Instead, it associates a new data set with an installation-defined management class
governing backup and migration.
|
MGMTCLAS is ignored if it is coded for an existing data set.
|
In this example, the data set SMCCOY.INV.FG109 has been associated with a
management class called "MC04".
|
What this means exactly depends on the installation.
|
Typically, it might mean that the data set is backed up every night at midnight, or
archived to a tape unit, or deleted after a certain period.
@@
MVS can read a number of input data sets in sequence as if they were a single data set.

|
Treating multiple data sets as one in this way is known as ^Rconcatenation^r.
|
Think of concatenation as "linking together".
|
The data sets are linked for the duration of a job step.
|
You cannot concatenate output data sets.
|
To concatenate data sets, you code the DD statement for the first data set in the sequence
in the normal way.
|
Then you code DD statements for each subsequent data set.
|
But you don't code ddnames for these data sets.
|
In this example, four data sets have been concatenated.
|
When MVS reaches the end of PUI09.SALES.AREA1, it automatically begins to read
records from PUI09.SALES.AREA2,
|
As you can see, only the first data set has a ddname.
|
You can concatenate any number of sequential data sets in this way.
|
The concatenated data sets can reside on different devices and on different types of
devices.
|
You may have to adjust DCB parameters to concatenate data sets on different devices.
|
Concatenated data sets must have the same RECFM.
|
And if they have fixed-length records, their LRECLs must be the same.
@@
You can concatenate PDSs as well as sequential data sets.
|
When you concatenate PDSs, their directories are linked together.
|
MVS searches each directory in turn until it finds the required member data set.
|
You can concatenate up to 114 PDSs.
|
If a requested member name is used in more than one PDS, MVS uses the first instance
that it encounters.
|
Concatenated data sets must be of the same type.

|
You cannot concatenate sequential and partitioned data sets together.
|
Provided they are of the same type, however, concatenated data sets can have different
block sizes.
|
You can concatenate sequential data sets with individual members of a PDS and instream data sets in any order.
@@
Suppose you are writing JCL to perform a particular task.
|
You have composed the JOB and EXEC statements.
|
In this exercise you are required to code some space allocation parameters on the DD
statement.
|
You use the ddname SALE to refer to a data set called KHART.SALE.ARK.
|
It is a new data set that will be cataloged.
|
It is to be stored on a 3390 unit with the volume label COB2.
|
Your next task is to allocate some space for the data set.
|
SMS is active at your installation, and you decide to allocate space in units of 1024
records.
|
You must code the AVGREC parameter accordingly.
|
Next you need to code the SPACE parameter.
|
You decide to make a primary allocation of 10 record units.
|
Your secondary allocation will be 2 units.
|
And the average size of each record will be 40 bytes.
|
Now you have specified that the primary allocation is 10 units of 1024 records, each of
which consists of 40 bytes.
|
The secondary allocation is 2 units of 1024 records.
|
In order to make efficient use of storage, you decide to release any free space that may be
left over after your data has been written.
|
Now you want to specify that the allocation must be contiguous.

|
Finally, you want to associate this data set with a management class that your installation
has previously defined.
|
The relevant management class is called "MGCL08".
|
The DD statement is now complete.
@@

Das könnte Ihnen auch gefallen