You can code VOL=REF on a
DD statement to refer to a DD statement
in the same or an earlier step to allocate the data set on the same
volume as the earlier data set. You can also code VOL=REF to an existing
data set (VOL=REF=A.B.C,...) where A.B.C is a cataloged data set.
If VOL=REF is coded, SMS invokes ACS routines as follows:
- SMS invokes the data class ACS routine.
- Storage
class is copied from the referenced
data set if the referenced data set has a storage class assigned to
it. However, if the referenced data set is an SMS-managed tape data
set and it is not cataloged or DISP is not OLD or MOD, the storage
class is not available. In that case, the ACS routine is called and
must specify a valid storage class for the referencing data set to
be an SMS-managed tape data set.
Note: - Non-SMS managed data sets do not have storage classes
to copy. As a result, the storage class routine is invoked and either
allows the non-SMS allocation or fails it. If it does anything else,
SMS fails it.
- When VOL=REF is coded to refer to a DD statement
and the referenced DD allocates a new data set (DISP=NEW), the storage
class is copied from the referenced DD if one is assigned.
When
VOL=REF is coded to refer to an SMS-managed tape data set, the storage
class from the referenced data set will not be available. The storage
class ACS routine is invoked and a valid storage class must be assigned;
otherwise, SMS fails it. For example, in the case of VOL=REF to an
SMS-managed tape data set, the storage class ACS routine must use
the read-only variables &LIBNAME,&ANYVOL,&ALLVOL to derive
a valid storage class that will allow this referencing data set to
be allocated to SMS-managed tape. Additionally, read-only variable &LABEL
can be used to help derive the valid storage class.
- The
storage class ACS routine is also invoked when
VOL=REF and UNIT=AFF is coded on the DD statement. For information
on what is passed to the storage class ACS routine, refer to Non-data set stacking allocations.
- If you use VOL=REF
processing to refer to a temporary data set,
you might get different results in storage group assignments than
expected. This is because temporary data sets are assigned a storage
group by the system, based on a list of eligible storage groups, such
as: VIO, PRIME, STANDARD, etc. Data sets that use VOL=REF are assigned
a storage group based on this list of eligible storage groups, not
on the name of the storage group used to successfully allocate the
first data set being referenced. This might result in the data sets
being allocated in different storage groups.
- Management class ACS routine is called if storage
class is not
null.
- The storage group from the referenced data set is passed
as input
to the storage group ACS routine. For data sets on SMS-managed tape
volumes, the ACS routine must assign the same storage group to the
referencing data set. For other SMS-managed data sets, any pool or
VIO storage group can be assigned to the referencing data set.
When you specify VOL=REF in the JCL, the system
retrieves the volume serial numbers from the referenced DD. In the
case of NEW to NEW referencing, since DD is not allocated yet, the
default of 1 is passed in the &NVOL parameter.
When VOL=REF
is used, the &ALLVOL and &ANYVOL ACS read-only
variables are set to 'REF=SD,' 'REF=ST' or 'REF=NS' as appropriate.
Additionally, if the reference is to a data set on an SMS-managed
volume, the storage group of the referenced data set is provided in
the &STORGRP read-write variable, if it is available. (For some
references to data sets on SMS-managed tape, it might not be, in which
case the ACS routine should use the value of the &LIBNAME read-only
variable instead.) If the referenced data set is new, it can still
have multiple candidate storage groups because it has not been allocated
yet. In that case only the first candidate
storage group is passed in.