CHKDKT (Check Diskette)
Purpose
The Check Diskette (CHKDKT) command searches a diskette in a specified device for a unique volume identifier and/or file label. If the volume identifier and/or file label are found on that diskette, a successful completion message is sent to the user who entered the command for that diskette. The diskette may be processed on the next diskette operation. If the correct diskette is not found, a message is sent to the user who entered the command. A check for this message in a CL program can direct the logic flow depending on whether the correct diskette is in the drive.
The diskette specified by the DEV parameter is searched. If a volume identifier is specified in the command, the volume identifier of the diskette is compared with the volume identifier in the command. If the correct volume identifier is found or if no volume identifier was specified in the command and a data file identifier is specified, the volume table of contents (VTOC) of the diskette is checked for the specified label.
If the correct data file identifier is found and the creation date is specified on the command, the date in the data file identifier is compared with that of the command. If they match, the correct file is found. If they do not match, the remaining labels in the VTOC are checked for both that data file identifier and the specified creation date.
If a match of the specified parameters is not found on the diskette, a message is sent to the user who entered the command.
Note: The identifiers are checked on each diskette in the following order:
- Volume identifier
- Data file identifier
- The date it was created
Each parameter is checked on the diskette if (and only if) the parameters before it in the list are found on that diskette or were not specified in the command. If a match of all parameters in the command is not found on the diskette, a message is sent to the user who entered the command.
Since this command can be used in a CL program to determine whether the diskette is to be processed, the message for a media error while reading the VTOC is not sent to the user. Instead, a status message is sent to the user who entered the command. The status message can be checked by giving control to the CL program. If the status message is not checked, a message is sent to the user who entered the command.
Restriction: If a diskette has an extended label area, that extension area is not checked when searching for a file label. An informational message is sent notifying the user of this omission.
Note: Results when processing diskettes with labels that are not IBM standard labels are unpredictable. Initialize the diskette by specifying CHECK(*NO) on the Initialize Diskette (INZDKT) command.
Required Parameters
- DEV
- Specifies the name of the device in which the diskette being checked 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 the volume identifier being compared with the volume identifier field on the diskette label. The identifier can have a maximum of 6 characters. Any combination of letters and numbers can be used. If the volume identifier does not match the diskette, an escape message is sent.
- LABEL
- Specifies whether a check is made for a specific file label on the diskette.
*NONE: No data file identifier check is made.
data-file-identifier: Specify the data file identifier that is being checked for. A search for that data file identifier is done on the diskette in the specified device.
- CRTDATE
- Specifies whether the creation date of the data file identifier being checked is also checked.
*NONE: The file creation date is not checked. If LABEL(*NONE) is specified, CRTDATE(*NONE) must also be specified.
creation-date: Specify the date that must match the creation date of the file being checked. The date must be entered in the format specified for the system values QDATFMT and, if separators are used, QDATSEP. When the correct file label is found, the creation date in that data file identifier is compared with the value in this parameter. If it does not match, the next data file identifier in the VTOC is checked.
Examples for CHKDKT
Example 1: Checking a Volume Identifier
CHKDKT DEV(QDKT) VOL(MASTER)This command checks the volume identifier of the diskette in device QDKT for a volume identifier of MASTER. If the volume identifier of the diskette is MASTER, a completion message is sent. If the volume identifier of the diskette is not MASTER, a message is sent indicating that the volume identifier is incorrect and the job must be sent again.
Example 2: Checking Volume Identifier and File Creation Date
CHKDKT DEV(QDKT) VOL(VOLID) LABEL(FILE) CRTDATE('7/4/76')This command searches the diskette in device QDKT for a volume identifier of VOLID. If a diskette is found with that volume identifier, the file labels on the diskette are checked for a data file identifier of FILE. If that data file identifier is found and the creation date of the file is 7/4/76, the correct file and diskette have been found, and a completion message is sent. If the correct volume identifier and data file identifier and creation date are not found, a message is sent to the user indicating that the volume identifier is incorrect and the job must be sent again.
Error messages for CHKDKT
*ESCAPE Messages
- CPF6162
- Diskette does not contain specified identifiers.
- CPF6708
- Command ended due to error.
- CPF6716
- Device &1 not a diskette device.
- CPF6718
- Cannot allocate device &1.
- CPF9814
- Device &1 not found.
- CPF9825
- Not authorized to device &1.