Status codes from SCRATCH

After the SCRATCH macro instruction is executed, the last byte of each 12-byte entry in the volume list indicates one of the conditions that are explained in Table 1.

Table 1. Status Codes from SCRATCH Macro Instruction
Scratch Status Code Meaning
0 (X'00') The format-1 DSCB for the data set has been deleted from the VTOC on the volume indicated.
1 (X'01') The VTOC of this volume does not contain the format-1 DSCB to be deleted.
2 (X'02') One of the following conditions occurred:
  • The data set could not be scratched because the console operator or TSO/E terminal operator did not specify the correct password in the two attempts allowed.
  • The user tried to scratch a VSAM data space or a catalogued VSAM data set.
  • The user tried to scratch the VTOC index data set.
  • An SMS validation failure occurred.
  • Verification of the last referenced date failed.
3 (X'03') The DSCB was not deleted because either the OVRD option was not specified or the retention cycle had not expired.
4 (X'04') One of the following conditions occurred:
  • A permanent I/O error or an invalid F1 DSCB was encountered when processing this volume.
  • An unexpected CVAF error return code was encountered.
  • An installation exit rejected the request.
  • An I/O error occurred while the DASD tracks occupied by the data set were being erased. Either the ERASE option had been specified in the scratch parameter list or the ERASE attribute had been specified for a RACF-defined data set.
  • Invalid F5 or F7 DSCB encountered, an invalid update to F5 or F7 DSCB was encountered, or an invalid extent in an F1, F2, or F3 was encountered when processing this data set on this volume.
5 (X'05') It could not be verified that this volume was mounted, nor was there a unit available for mounting the volume.
6 (X'06') The operator was unable to mount this volume.
7 (X'07') The format-1 DSCB was not deleted because the data set was open.
8 (X'08') The format-1 DSCB indicates the data set is defined to RACF®, but either you are not authorized to the data set or to the volume, or the data set is a VSAM data space.

After the SCRATCH macro instruction is executed, the next to last byte of the first entry in the volume list indicates one of the conditions that are described in Table 2.

Table 2. Secondary Status Codes
Secondary Status Code   Description
0 (X'00') No secondary status for this volume.
128 (X'80') The data set was RACF-protected and the user was authorized by the RACF DATASET class to scratch the data set. This means that at least one volume entry was protected.