CRTDKTF Command syntax diagram
Purpose
The Create Diskette File (CRTDKTF) command creates a diskette device file. The device file contains the file description, which identifies the device to be used and specifies the input and output data spooling requirements; the device file does not contain data. The diskette device file is used to read and write records on diskettes that are in the diskette device and that have been initialized in the basic, H, or I exchange format. The same device file is used for both input and output operations.
| Note: | This command is not used to create device files for use in save/restore operations. User-created device files are not needed for save/restore operations. |
All the information in the diskette file description is contained in the command that creates it; there is no data description specifications (DDS) for diskette device files. The diskette file has only one record format for input/output operations. The record format consists of one character field containing the input data retrieved from the device or the output data written to the device. The program using the device file must describe the fields in the record format so that the program can arrange the data either received from or sent to the device in the manner specified by the diskette file description.
Required Parameter
The name of the diskette file can be qualified by one of the following library values:
*CURLIB: The diskette file is created in the current library for the job. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library where the diskette file is created.
diskette-device-file-name: Specify the name of the diskette device file being created.
Optional Parameters
*NONE: No device name is specified. The name of the diskette device can be specified before the device file is opened, in a Change Diskette File (CHGDKTF) command or Override with Diskette File (OVRDKTF) command, or in the high-level language program that opens the file.
device-name: Specify the name of the device that is used with this diskette device file. The device name must already exist on the system as a device description before this device file is created.
*NONE: The diskette volume identifiers are not specified for this file in this command. They can be specified later before the device file is opened, either in a Override with Diskette File (OVRDKTF) command or a Change Diskette File (CHGDKTF) command, or in the high-level language program. Otherwise, no volume identifier checking is done.
volume-identifier: Specify the identifiers of one or more volumes in the order in which they are put on the device and used. Each volume identifier contains a maximum of 6 alphanumeric characters. A blank is used as a separator character when listing multiple identifiers.
*NONE: The data file label is not specified here. It can be specified before the device file is opened, in a CHGDKTF or OVRDKTF command, or in the high-level language program that opens the file.
data-file-label: Specify up to 8 characters for the identifier of the data file used with this diskette device file.
*DATA: The diskette file describes data records.
*SRC: The diskette file describes source records.
*STD: The basic exchange format is used for a type 1 or a type 2 diskette. The H exchange type is used for a type 2D diskette.
*BASIC: The basic exchange type is used.
*H: The H exchange type is used.
*I: The I exchange type is used.
*EBCDIC: The extended binary-coded decimal interchange code (EBCDIC) character set code is used.
*ASCII: The ASCII character set code is used.
| Note: | The creation date parameter is valid only for diskette input data files. If the creation date written on the diskette containing the data file does not match the date specified for the device file when it is opened, an error message is sent to the user program. |
*NONE: The creation date is not specified. It is not checked unless it is supplied before the device file is opened, either in a OVRTAPF command or CHGTAPF command, or in the high-level language program.
creation-date: Specify the creation date of the data file used by this device file. The date must be specified in the format defined by the job attributes DATFMT and, if separators are used, DATSEP. However, the specified date is put in the diskette label in the format yymmdd.
*NONE: No expiration date for the data file is specified; the file is protected for 1 day. Its protection ends the day after it is created.
*PERM: The data file is permanently protected. An expiration date of 999999 is assigned.
expiration-date: Specify the expiration date of the data file. The date must be specified in the format defined by the job attributes DATFMT and, if separators are used, DATSEP. However, the specified date is put in the diskette label as yymmdd.
*NO: The data is not spooled. If this file is opened for input, the data is read directly from the diskette. If this is an output file, the data is written directly to the diskette as it is processed by the program.
| Note: | If SPOOL(*NO) is specified, the following parameters in this command are ignored: OUTQ, MAXRCDS, SCHEDULE, HOLD, SAVE, OUTPTY, and USRDTA. |
*YES: The data is spooled. If this file is opened for input, an inline data file having the specified name is processed; otherwise, the next unnamed inline spooled file is processed. More information on named and unnamed inline files is in the Tape and Diskette Device Programming book. If this is an output file, the data is spooled for processing by a diskette or print writer.
The name of the output queue can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
QDKT: The spooled output data is sent to the IBM-supplied QDKT output queue. If no library qualifier is specified, *LIBL is used to find the output queue.
output-queue-name: Specify the name of the output queue to which the output data is spooled. The IBM-supplied output queue that is used by the diskette file is the QDKT output queue, stored in the QGPL library.
100000: Up to 100,000 records are in the spooled file for the diskette data file that is produced by this device file.
*NOMAX: The system maximum is used.
maximum-records: Specify the maximum number of diskette records that are in the spooled file. Valid values range from 1 through 500000.
*FILEEND: The spooled file is made available to the writer as soon as the file is closed in the program.
*JOBEND: The spooled file is made available to the writer only after the entire job is completed.
*IMMED: The program does not wait; when the file is opened, an immediate allocation of the file resources is required.
*NO: The spooled printer file is not held by the output queue. The spooled output is available to a writer based on the SCHEDULE parameter value.
*YES: The spooled file is held until released by the Release Spool File (RLSSPLF) command.
*NO: The spooled file data is not saved on the output queue after it has been produced.
*YES: The spooled file data is saved on the output queue until the file is deleted.
*JOB: The output priority associated with the job that created the spooled file is used.
output-priority: Specify the output priority. Valid values range from 1 (high priority) through 9 (low priority).
*BLANK: Ten blanks are used as the user data.
user-data: Specify up to 10 characters of text.
*NO: The file does not process DBCS data.
*YES: The file processes DBCS data.
| Note: | An immediate allocation of the device by the device resource is required when an acquire operation is performed to the file. |
*IMMED: The program does not wait; when the file is opened, an immediate allocation of the file resources is required.
*CLS: The job default wait time is used as the wait time for the file resources being allocated.
number-of-seconds: Specify the number of seconds that the program waits for the file resources to be allocated to the diskette file when the file is opened, or the wait time for the device allocated when an acquire operation is performed to the file. Valid values range from 1 through 32767 seconds.
More information on shared database files is in the DB2 UDB for AS/400 Database Programming book.
*NO: The ODP created by the program with this attribute is not shared with other programs in the routing step. Every time a program opens the file with this attribute, a new ODP to the file is created and activated.
*YES: The ODP created with this attribute is shared with each program in the routing step that also specifies SHARE(*YES) when it opens the file.
| Note: | When SHARE(*YES) is specified and control is passed to a program, a read operation in that program retrieves the next input record. A write operation produces the next output record. |
*LIBCRTAUT: The public authority for the diskette file is taken from the value on the CRTAUT parameter of the target library (the library that is to contain the diskette file). The public authority is determined when the diskette file is created. If the CRTAUT value for the library changes after the diskette file is created, the new value does not affect any existing objects.
*CHANGE: The user can perform all operations on the diskette file except those limited to the owner or controlled by object existence authority and object management authority. The user can change and perform basic functions on the diskette file. Change authority provides object operational authority and all data authority.
*ALL: The user can perform all operations except those limited to the owner or controlled by authorization list management authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the diskette file.
*USE: The user can perform basic operations on the diskette file, such as running a program or reading a file. The user cannot change the diskette file. *USE authority provides object operational authority, read authority, and execute authority.
*EXCLUDE: The user cannot access the diskette file.
authorization-list-name: Specify the name of the authorization list used.
*YES: The existing diskette file is replaced by the one being created.
*NO: The existing file, if any, is not replaced by the diskette file.
*BLANK: Text is not specified.
'description': Specify no more than 50 characters of text, enclosed in apostrophes.
Examples for CRTDKTF
Example 1: Creating Diskette Device File
CRTDKTF FILE(DSPHST)
This command creates a diskette device file named DSPHST. The defaults for all the other parameters are assumed. The device name, diskette volume, file label, and the creation date of the data file on diskette must be specified in another CL command or in each program that uses the device file. The device file describes diskette data files that are in EBCDIC code and that are spooled for both input and output. Output goes to the QDKT output queue and then onto diskette as soon as the file is closed by the program. When output is produced from the output queue, only one copy is produced.
Example 2: Specifying DBCS Data Processing
CRTDKTF FILE(IGCLIB/IGCDKT) IGCDTA(*YES)
This command creates a diskette device file named IGCDKT, which is stored in the library IGCLIB, and it can process double-byte character set (DBCS) data.
Error messages for CRTDKTF
*ESCAPE Messages
| [ Information Center Home Page | Feedback | Back to main CL topic ] | [ Legal | AS/400 Glossary ] |