Volume reference

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:

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.