A new variable insures proper SNC2 processing regardless of the device type that
the pre-existing allocation is on, versus what device the new allocation will be on.
Currently, the typical test for an SNC2 condition in the SPACE Environment is:
IF (&IFCAT = 'Y') AND (&DEVCLAS = 'XXXX') THEN DO
Then the typical process statement would be:
SET &SNC2 = 'D' to delete if you are testing for DEVCLAS = 'DISK' or...
SET &SNC2 = 'U' to uncatalog if you are testing for DEVCLAS = 'TAPE' .
Using &DEVCLAS does have a big exposure:
The &DEVCLAS variable returns TAPE or DISK for the NEW (to-be-allocated) data set
and not the OLD (pre-existing) data set.
So, if the NEW allocation is NOT to the same &DEVCLAS as the pre-existing data set,
the SNC2 action will fail.
PTF RO91755 provides a new ASR variable in the SPACE environment &IFALREADYCATDEVCLAS
[alias &IFCATDEV]. This variable returns the device class of the OLD allocation so that
your SNC2 logic can properly dispose of the OLD data set that is involved in an SNC2 process.
An example of SNC2 logic with this new variable would be:
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
IF &IFCAT = 'Y' AND &IFCATDEV = 'DISK' THEN
DO
SET &SNC2 = 'D'
SET &N0 = &SNC2RC
IF &N0 = 0 THEN /* GOOD SNC2 FOR DISK DATA SET */
DO
WRITE 'SNC2RC = &N0 - SNC2 DELETE SUCCESFUL FOR'
WRITE 'DISK DSN=&DSN'
EXIT CODE(0)
END
IF &N0 GT 0 THEN /* BAD SNC2 FOR DISK DATA SET */
DO
WRITE 'SNC2RC = &N0 - SNC2 DELETE NOT SUCCESFUL FOR'
WRITE 'DISK DSN=&DSN'
EXIT CODE(8)
END
END
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
IF &IFCAT = 'Y' AND &IFCATDEV = 'TAPE' THEN
DO
SET &SNC2 = 'U'
SET &N0 = &SNC2RC
IF &N0 = 0 THEN /* GOOD SNC2 FOR TAPE DATA SET */
DO
WRITE 'SNC2RC = &N0 - SNC2 UNCATLG SUCCESFUL FOR'
WRITE 'TAPE DSN=&DSN'
EXIT CODE(0)
END
IF &N0 GT 0 THEN /* BAD SNC2 FOR TAPE DATA SET */
DO
WRITE 'SNC2RC = &N0 - SNC2 UNCATLG NOT SUCCESFUL FOR'
WRITE 'TAPE DSN=&DSN'
EXIT CODE(8)
END
END
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Please contact CA Technical Support if you have any questions.