Example: storage class ACS routine specifying both volume reference and unit affinity

In Figure 1, the storage class routine ensures that even if only UNIT=AFF is specified, the AFF'ed DD storage class will be assigned.
Figure 1. Example of a Storage Class ACS Routine Specifying Both Volume Reference and Unit Affinity
IF &ANYVOL = 'REF=ST' OR &ANYVOL = 'REF=SD' THEN
  	SET &STORCLAS = &STORCLAS
ELSE
  	IF &UNIT = 'AFF=SMST' OR &UNIT = 'AFF=SMSD' THEN
             DO
                 IF &STORCLAS = '' THEN
                     SET &STORCLAS = 'xxxxxxxx' /* TO BREAK AFFINITY */
                 ELSE
                     SET &STORCLAS = &STORCLAS /* TO HONOR AFFINITY */
             END
      WRITE 'STORCLAS SET TO '&STORCLAS