When two or more volumes are assigned the same device, the volumes are said to have unit affinity within the same job step allocation. Unit affinity implies deferred mounting for all except one of the volumes.
//ST1 EXEC
//DD1 DD DSN=A,DISP=(,CATLG),UNIT=3480
//DD2 DD DSN=B,DISP=(,CATLG),UNIT=AFF=DD1
//DD3 DD DSN=C,DISP=(,CATLG),UNIT=AFF=DD2
A related concept is volume affinity. When two or more data sets share one or more volumes, the data sets have volume affinity. See Stacking data sets for additional information on stacking data sets on one or more volumes.
//ddname DD UNIT=AFF=ddname,...
//DD1 DD DSNAME=dataset1,...
// DD DSNAME=dataset2,UNIT=AFF=DD1,...
// DD DSNAME=dataset3,UNIT=AFF=DD1,...
//DD1 DD DSNAME=dataset1,...
//DD2 DD DSNAME=dataset2,UNIT=AFF=DD1,...
//DD3 DD DSNAME=dataset3,UNIT=AFF=DD2,...
//DD4 DD DSNAME=dataset3,UNIT=AFF=DD3,...
//DD1 DD DSNAME=dataset1,...
//DD2 DD DSNAME=dataset2,UNIT=AFF=DD1,...
//DD3 DD DSNAME=dataset3,UNIT=AFF=DD1,...
//DD4 DD DSNAME=dataset3,UNIT=AFF=DD1,...
Always referencing the previous DD means that, if any condition causes the system to ignore unit affinity for one of the DDs in the chain, any subsequent DDs in the chain will still be allocated to a single unit, rather than to different units.
Implied unit affinity: Implied unit affinity exists among the volumes for one data set when the DD statement requests more volumes than devices.
Unit affinity processing for Data Sets on a System-Managed Tape Volume: Table 1 contains examples that apply unit-affinity principles to data sets requested on system-managed tape volumes. The system verifies that the primary (referenced) DD statement has a device pool that is a proper subset of the secondary (referencing) DD statement. Therefore, the system honors unit-affinity requests only when each device type to which the primary DD statement is eligible is also contained in the device pool of the secondary DD statement.
Requestor | Library eligibility | Device type eligibility | Action taken | Final eligibility |
---|---|---|---|---|
Libraries and device pools of requestors are identical | ||||
Primary | LIB1 | 3490 | Honor | LIB1, 3490 |
Secondary | LIB1 | 3490 | ||
Libraries of primary requestor are proper subset of secondary | ||||
Primary | LIB1 | 3490 | Honor and Reduce | LIB1, 3490 |
Secondary | LIB1, LIB2 | 3490 | ||
Device pool of primary requestor is proper subset of secondary | ||||
Primary | LIB1 | 3490 | Honor and Reduce | LIB1 and 3490 |
Secondary | LIB1 | 3490, 3480X | ||
Libraries of primary requestor are completely different from secondary | ||||
Primary | LIB1 | 3490 | Ignore | LIB1, 3490 |
Secondary | LIB2 | 3490 | LIB2, 3490 | |
Device pool of primary requestor is completely different from secondary | ||||
Primary | LIB1 | 3490 | Ignore | LIB1, 3490 |
Secondary | LIB1 | 3480X | LIB1, 3480X | |
Libraries of primary requestor are not proper subset of secondary | ||||
Primary | LIB1, LIB2 | 3490 | Ignore | LIB1, LIB2, 3490 |
Secondary | LIB1 | 3490 | LIB1, 3490 | |
Device pool of primary requestor is not proper subset of secondary | ||||
Primary | LIB1 | 3490, 3480X | Ignore | LIB1, 3490, 3480X |
Secondary | LIB1 | 3480X | LIB1, 3480X | |
Device pools identical; both are non-library requestors | ||||
Primary | Non-library request | 3490 | Honor | 3490 |
Secondary | Non-library request | 3490 | ||
Device pool of primary requestor is proper subset of secondary; both are non-library requestors | ||||
Primary | Non-library request | 3490 | Honor and Reduce | 3490 |
Secondary | Non-library request | 3490, 3480X | ||
Device pool of primary requestor is not proper subset of secondary; both are non-library requestors | ||||
Primary | Non-library request | 3490, 3480X | Ignore | 3490, 3480X |
Secondary | Non-library request | 3490 | 3490 | |
Primary is library requestor but secondary is non-library requestor | ||||
Primary | LIB1 | 3490 | Ignore | LIB1, 3490 |
Secondary | Non-library request | 3490 | 3490 |
Device eligibility: Non-system-managed data sets are eligible to a device when they can be allocated to that device type. The data sets on a system-managed tape volume are eligible to a device when they can be allocated to that device type, and when both the volume and the device reside in the same system-managed tape library. The catalog contains information about the types of devices to which a data set is eligible only if the data set is cataloged.
For the system to honor a request for unit affinity, the referenced DD must be eligible to the same devices as the referencing DD statement. In addition, the devices to which the referenced DD statement is eligible must either be a subset of, or the same as, the devices to which the referencing DD is eligible. In all other cases, the system ignores unit affinity, but the allocation will succeed.
//DD1 DD UNIT=TAPEX
//DD2 DD DSN=DS3480,UNIT=AFF=DD1
//DD3 DD DSN=DS3480X,UNIT=AFF=DD2
//DD4 DD DSN=DS3480X2,UNIT=AFF=DD1
Exception to Device Eligibility
//DD1 DD UNIT=3480X
//DD2 DD DSN=DS3480,UNIT=AFF=DD1
In this example, the system does not honor the request for unit affinity; each DD statement is allocated to a separate device.