The SCRATCH statement is used to scratch a data set or member from
a DASD volume. A data set or member is scratched only from the volumes
designated in the SCRATCH statement. This function does not delete
catalog entries for scratched data sets.
A SCRATCH operation will not be processed if the data set or volume
is being used by a program executing concurrently. "DISP=OLD" on
the DD statement only prevents the inadvertent deletion of a data
set. It does not ensure exclusive use of the data set during execution
of the job step. When scratching a member of a partitioned data set,
it is your responsibility to ensure that the data set is not currently
in use.
For multivolume data sets, all volumes specified must be online.
When scratching a data set managed by the Storage Management Subsystem
(SMS), care must be taken to ensure that the device type and volumes
list on the VOL parameter reflects the volume actually allocated to
the data set. When you specify a volume when creating an SMS-managed
data set, SMS will not automatically allocate the data set on that
volume.
When scratching an SMS-managed data set, IEHPROGM will uncatalog
that data set.
The syntax of the SCRATCH statement is shown below.
Label |
Statement |
Parameters |
---|
[label]
|
SCRATCH
|
{VTOC|DSNAME=name}
,VOL=device=(list)
[,PURGE]
[,MEMBER=name]
[,SYS]
|
where:
- VTOC
- specifies that all data sets on the designated volume be scratched,
except for
- a data set that is protected by a password
- a data set whose expiration date has not passed
- a data set that contains the index for an indexed VTOC
Password-protected data sets are scratched if the correct password
is provided.
The effect of VTOC is modified when it is used with
PURGE or SYS.
- DSNAME=name
- specifies the fully qualified name of the data set to be scratched
or the partitioned data set that contains the member to be scratched.
The name must not exceed 44 characters, including delimiters.
- VOL=device=(list)
- specifies the device type and serial numbers of the volumes,
limited to 50, that contain the data sets. If only one serial number
is listed, it need not be enclosed in parentheses. Multiple serial
numbers should be separated with commas.
If VTOC or MEMBER is specified,
VOL cannot specify more than one volume. Caution should be used when
specifying VTOC if VOL specifies the system residence volume.
- PURGE/NOPURGE
- specifies whether data sets designated by DSNAME or VTOC are
scratched.
The presence of the PURGE or NOPURGE keyword may be
ignored for SMS managed data sets. When OVRD_EXPDT is specified in
the IGDSMSxx member of SYS1.PARMLIB, the PURGE and NOPURGE keywords
are not honored. The data set is always deleted, whether or not it has expired.
This is true only if the data set is a DASD data set and SMS managed.
The use of the PURGE and NOPURGE keywords is unchanged for non-SMS
managed data sets.
- MEMBER=name
- specifies a member name or alias of a member (in the named data
set) to be removed from the directory of a partitioned data set. This
name is not validity-checked because all members must be accessible,
whether the name is valid or not.
Default:
The entire data set or volume of data sets specified by name is scratched.
- SYS
- limits the action of SCRATCH VTOC so that only temporary data
sets are erased. This means data sets whose names were coded beginning
with an ampersand on JCL. An example is
DSN=&LIB
Temporary
data sets have names beginning with "AAAAAAAA.AAAAAAAA.AAAAAAAA.AAAAAAAA." or "SYSnnnnn.T" with "F", "V", or "A" in
position 19. These are names assigned to the data sets by the operating
system.
If the name of the data set is in this form, it is likely
to be a temporary data set which was not erased at normal step or
job termination; nnnnn is the date the data set was created in yyddd
format.
The SYS parameter is valid only when VTOC is specified.