CLRDKT (Clear Diskette)

CLRDKT Command syntax diagram

 

Purpose

The Clear Diskette (CLRDKT) command deletes all active and inactive files from a diskette by deleting the data file identifiers from the diskette label area. A single (expired) file is defined, covering the entire diskette, and is identified as DATA. The data contained in the files is not deleted. Refer to the DLTDKTLBL (Delete Diskette Label) command and the INZDKT (Initialize Diskette) command to delete the data in the files.

The CLRDKT command does not test the diskette for defects nor does it change the volume identifier and owner identifier fields. The error map also does not change.

The diskette in the specified device (DEV parameter) is cleared by the CLRDKT command. If no volume identifier is specified, the command clears the diskette in the specified device. If an identifier is specified and it is the same as the identifier on the diskette in the specified device, the diskette is cleared.

Note: When processing diskettes with labels that are not IBM standard labels, you may get unpredictable results. To initialize the diskette, enter the Initialize Diskette (INZDKT) command, with CHECK(*NO) specified.

Restriction: A diskette that has an extended label area cannot be cleared; it must be initialized by the Initialize Diskette (INZDKT) command.

 

Required Parameters

DEV
Specifies the name of the device in which the diskette being cleared is located.

 

Optional Parameters

VOL
Specifies one or more volume identifiers used by the file. More information on this parameter is in Commonly used parameters.

*MOUNTED: The volume currently placed in the device is used.

volume-identifier: Specify a volume identifier to be compared with the diskette label volume identifier field of the diskette being cleared. The identifier can have up to 6 characters. Any combination of letters and numbers can be used.

CHECK
Specifies whether to check the diskette in the specified device for active files before it is cleared. Active files are files having an expiration date later than the system date.

*YES: A check is performed on files whose labels are in cylinder 0 only. File labels in an extended file label area (not supported by the iSeries 400) are not checked. If any active files are found on a diskette, a message is sent to the system operator. The operator can continue the clear function, and erase the active files, or he can end the operation.

*NO: The diskette is cleared without being checked for active files.

Examples for CLRDKT

Example 1: Clearing Diskette with Volume Identifier of MASTER

CLRDKT   DEV(QDKT)  VOL(MASTER)  CHECK(*NO)

This command clears the diskette in device QDKT if its volume identifier is MASTER.

Example 2: Checking for Active Files Before Diskette is Cleared

CLRDKT   DEV(DKT1)

This command clears the diskette in device DKT1. Because VOL(*MOUNTED) is assumed, the diskette could be in either the basic exchange or save/restore formats, and a volume identification check is not made. However, because CHECK(*YES) is also assumed, the diskette is checked for active files before it is cleared.

Error messages for CLRDKT

*ESCAPE Messages

CPF6156
Cancel reply received for message &6.
CPF6159
Clear diskette ended; previous errors occurred.
CPF9814
Device &1 not found.
CPF9825
Not authorized to device &1.