Where allowed to run: All environments (*ALL) Threadsafe: Conditional |
Parameters Examples Error messages |
The Create Physical File (CRTPF) command creates a physical file from the information specified on this command and (optionally) from the data description specifications (DDS) contained in a source file.
A physical file is a database file that contains data records. The data records are grouped into physical file members and each member has its own access path to the data. Normally, database files have only one member which, by default, is added to the file when the file is created. If the desired physical file has a record format with only one character field in arrival sequence or if the file is a source file, a DDS source file is not needed. To override attributes of the file after it has been created, use the Override Database File (OVRDBF) command before the file is opened. To change attributes of the file after it has been created, use the Change Physical File (CHGPF) command.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
FILE | File | Qualified object name | Required, Positional 1 |
Qualifier 1: File | Name | ||
Qualifier 2: Library | Name, *CURLIB | ||
SRCFILE | Source file | Qualified object name | Optional, Positional 2 |
Qualifier 1: Source file | Name, QDDSSRC | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
SRCMBR | Source member | Name, *FILE | Optional, Positional 3 |
RCDLEN | Record length, if no DDS | Integer | Optional, Positional 4 |
GENLVL | Generation severity level | 0-30, 20 | Optional |
FLAG | Flagging severity level | 0-30, 0 | Optional |
FILETYPE | File type | *DATA, *SRC | Optional |
MBR | Member, if desired | Name, *FILE, *NONE | Optional |
IGCDTA | User specified DBCS data | *NO, *YES | Optional |
TEXT | Text 'description' | Character value, *SRCMBRTXT, *BLANK | Optional |
OPTION | Source listing options | Values (up to 4 repetitions): *SRC, *NOSRC, *SOURCE, *NOSOURCE, *LIST, *NOLIST, *SECLVL, *NOSECLVL, *EVENTF, *NOEVENTF | Optional, Positional 5 |
SYSTEM | System | *LCL, *RMT, *FILETYPE | Optional |
EXPDATE | Expiration date for member | Date, *NONE | Optional |
MAXMBRS | Maximum members | Integer, 1, *NOMAX | Optional |
ACCPTHSIZ | Access path size | *MAX1TB, *MAX4GB | Optional |
PAGESIZE | Access path logical page size | *KEYLEN, 8, 16, 32, 64, 128, 256, 512 | Optional |
MAINT | Access path maintenance | *IMMED, *DLY, *REBLD | Optional |
RECOVER | Access path recovery | *NO, *AFTIPL, *IPL | Optional |
FRCACCPTH | Force keyed access path | *NO, *YES | Optional |
SIZE | Member size | Single values: *NOMAX Other values: Element list |
Optional |
Element 1: Initial number of records | 1-2147483646, 10000 | ||
Element 2: Increment number of records | Integer, 1000 | ||
Element 3: Maximum increments | Integer, 3 | ||
ALLOCATE | Allocate storage | *NO, *YES | Optional |
CONTIG | Contiguous storage | *NO, *YES | Optional |
UNIT | Preferred storage unit | 1-255, *ANY | Optional |
FRCRATIO | Records to force a write | Integer, *NONE | Optional |
WAITFILE | Maximum file wait time | Integer, 30, *IMMED, *CLS | Optional |
WAITRCD | Maximum record wait time | Integer, 60, *IMMED, *NOMAX | Optional |
SHARE | Share open data path | *NO, *YES | Optional |
DLTPCT | Max % deleted records allowed | 1-100, *NONE | Optional |
REUSEDLT | Reuse deleted records | *YES, *NO | Optional |
SRTSEQ | Sort sequence | Single values: *SRC, *JOB, *LANGIDSHR, *LANGIDUNQ, *HEX Other values: Qualified object name |
Optional |
Qualifier 1: Sort sequence | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
LANGID | Language ID | Character value, *JOB | Optional |
CCSID | Coded character set ID | Integer, *JOB, *HEX | Optional |
ALWUPD | Allow update operation | *YES, *NO | Optional |
ALWDLT | Allow delete operation | *YES, *NO | Optional |
LVLCHK | Record format level check | *YES, *NO | Optional |
NODGRP | Node group | Single values: *NONE Other values: Qualified object name |
Optional |
Qualifier 1: Node group | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
PTNKEY | Partitioning Key | Values (up to 300 repetitions): Name | Optional |
AUT | Authority | Name, *LIBCRTAUT, *ALL, *CHANGE, *EXCLUDE, *USE | Optional |
Top |
Specifies the physical file to be created.
This is a required parameter.
Qualifier 1: File
Qualifier 2: Library
Top |
Specifies the source file that contains the data description specifications (DDS) that describe the record format and its fields, and the access path for the file and its members. The specifications that are made in DDS are described in the Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter and the DDS Reference information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Note: If a value is specified for this parameter, a value cannot be specified for the Record length (RCDLEN) parameter.
Qualifier 1: Source file
Qualifier 2: Library
Top |
Specifies the name of the source file member that contains the DDS for the physical file being created; the member is in the source file specified in the SRCFILE parameter (or its default, QDDSSRC). If SRCMBR is specified, RCDLEN cannot be specified.
Top |
Specifies the length (in bytes) of the records stored in the physical file. If RCDLEN and FILETYPE(*DATA) are specified, the physical file is created with a record format that has only one field. The file is then restricted to an arrival sequence access path. The record format and the field are both assigned the same name as that of the file, specified in the FILE parameter. A value ranging from 1 through 32766 bytes can be specified for the record length.
If RCDLEN and FILETYPE(*SRC) are specified, the record format has three fields: source sequence number, date, and source statement. The RCDLEN parameter must provide six positions for the source sequence number, six positions for the date field, and one position for source start, which are required in each record. These fields are defined with fixed attributes and names. If records are copied into the file by the CPYF command and the records are longer than the length specified, the records are truncated on the right.
If RCDLEN is specified, SRCFILE and SRCMBR cannot be specified; RCDLEN is used to specify a fixed record length for the record format when a source file is not needed (when only one field exists in each record or when the file being created is a source file). The high-level language program that processes the file must describe the fields in the record in the program.
Double-Byte Character Set Considerations
If IGCDTA(*NO) is specified, the field is assigned the data type of character whose length is the same as the record length specified. A value ranging from 1 to 32766 bytes can be specified for the record length. If IGCDTA(*YES) is specified, the field is assigned the data type of DBCS-open and a value ranging from 4 to 32766 can be specified.
The RCDLEN parameter must provide six positions for the source sequence number, six positions for the date field, and four positions for source start when FILETYPE(*SRC) and IGCDTA(*YES) are specified.
Top |
Specifies the severity level at which the create operation fails. If errors occur that have a severity level greater than or equal to this value, the operation ends.
This parameter applies only to messages created while processing DDS source files.
Top |
Specifies the minimum severity level of messages to be listed.
Top |
Specifies whether each member of the physical file being created contains data records or contains source records (statements) for a program or another file. The file can contain, for example, RPG source statements for an RPG program or DDS source statements for another physical, logical, or device file.
Top |
Specifies the name of the physical file member added when the physical file is created.
Top |
Specifies, for program-described files, whether the file processes double-byte character set (DBCS) data. Specifies, for externally described files, the DBCS attributes of the file.
Note: This parameter has no meaning for physical files created using DDS, because the use of DBCS data is specified in the DDS.
Double-Byte Character Set Considerations
If the user creates a physical file and specifies the RCDLEN parameter, the system creates a default record format.
The system ignores the IGCDTA parameter value if a value for the RCDLEN parameter is not specified.
The user cannot override the IGCDTA value for a physical file.
Top |
Specifies the text that briefly describes the object.
Top |
Specifies the type of output produced when the file is created. A maximum of four of the following values can be specified in any order on this parameter. If neither or both of the values on an option are specified, the first value is used.
Note: The first values on each option are similar to, but are not actually default values, and therefore, cannot be changed with the CHGCMDDFT (Change Command Default) command.
Source Listing Option
Program Listing Option
Second-Level Message Text Option
Event File Creation Option
Top |
Specifies whether the physical file is created on the local system or the remote system.
Top |
Specifies the expiration date for members of the physical file.
Top |
Specifies the maximum number of members that the physical file can contain.
Top |
Specifies the maximum size of auxiliary storage that can be occupied by the following kinds of access paths:
This parameter does not apply to access paths that are created for logical files or for queries that refer to the data in a physical file.
Top |
Specifies the access path logical page size that is used when the access path is created.
The access path logical page size is used by the system to determine the size of each page of the index. This logical page size is the amount of bytes of the access path that can be moved into the job's storage pool from the auxiliary storage for a page fault.
Top |
Specifies, for files with key fields, the type of access path maintenance used for all members of the physical file.
If the number of changes between a close and the next open reaches approximately 10 percent of the access path size, the system stops saving changes and the access path is completely rebuilt the next time the file is opened.
Top |
Specifies, for files with immediate or delayed access path maintenance, when recovery processing of the file is performed if the access path is being changed when a system failure occurs. This parameter is valid only for a file with a keyed access path.
If *IMMED is specified for the Access path maintenance (MAINT) parameter, the access path can be rebuilt during initial program load (IPL) (before any user can run a job), or after IPL has ended (during jobs running at the same time), or when the file is next opened. While the access path is being rebuilt, the file cannot be used by any job.
During the IPL, an Override Access Path Recovery display lists those access paths that must be recovered and the RECOVER parameter value for each access path. The user can override the RECOVER parameter value on this display. More information on access paths is in the Backup and Recovery book, SC41-5304.
If *REBLD is specified for the MAINT parameter, the access path is rebuilt the next time its file is opened.
Note: *NO is the default for all files that do not require unique keys.
Note: *AFTIPL is the default for all files that require unique keys.
Top |
Specifies, for files with key fields, whether access path changes are forced to auxiliary storage along with the associated records in the file. FRCACCPTH(*YES) minimizes (but does not remove) the possibility that an abnormal job end may cause damage to the access path that requires it to be rebuilt.
FRCACCPTH(*YES) slows the response time of the system if the access path is changed in an interactive job. If the access path is changed frequently, the overall performance of the system is decreased.
Top |
Specifies the initial number of records in each member of the file, the number of records in each part added to the member size, and the number of times the part added is automatically applied. The number of records for each file member is specified as the number of records that can be placed in it (this number includes any deleted records).
When the maximum number of records has been reached, a message (stating that the member is full) is sent to the system operator, giving the choice of ending the request or extending the member size. The operator can extend the member by 10% or by the number of records specified as the increment value, whichever is greater, each time the message is received.
Single values
Element 1: Initial number of records
Specify the initial number of records in each member.
Element 2: Increment number of records
Specify the number of records that are automatically added to the member when the number of records in the member is greater than the initial member size. The minimum size of an increment is 10% of the size of the member at the time the maximum number of records is reached.
If the number specified is not greater than 10% of the member size and not equal to zero, the member size is increased by 10%.
If 0 is the specified increment value, the member is not automatically extended. This value must be 0 if the value for the number of increments is 0.
Element 3: Maximum increments
Specify the maximum number of increments that can be automatically added to the member.
Top |
Specifies whether initial storage space is allocated to each physical file member added to the file. The allocation provides enough space to hold the number of records specified for the Member size (SIZE) parameter. Allocations that occur when a record cannot be added to a member without exceeding its capacity are determined by the system and by the SIZE parameter values.
Top |
Specifies, for each physical file member added to the file, whether all of the records in the initial storage allocation must be stored next to each other.
Top |
This parameter is no longer supported. It exists solely for compatibility with releases earlier than Version 3 Release 6 Modification 0 of the OS/400 operating system. For information on using auxiliary storage pools (ASPs), refer to the Backup and Recovery book, SC41-5304.
You can specify the value *ANY or a value ranging from 1 through 255 on this parameter.
Top |
Specifies the number of inserted or updated records that are processed before the records are forced into auxiliary storage. If this physical file is being journaled, either a large number or *NONE should be used. *NONE may cause long synchronization of the journal and physical files.
Top |
Specifies the number of seconds that the program waits for the file resources to be allocated when the file is opened, or the device or session resources to be allocated when an acquire operation is performed to the file. If the file resources cannot be allocated in the specified wait time, an error message is sent to the program.
Top |
Specifies the number of seconds that the program waits for a record being changed or deleted. If the record cannot be allocated within the specified wait time, an error message is sent to the program.
Top |
Specifies whether the open data path (ODP) is shared with other programs in the same routing step. When an ODP is shared, the programs accessing the file share facilities such as the file status and the buffer.
Note: This parameter cannot be specified when *NONE is specified for the Member (MBR) parameter.
Top |
Specifies the maximum allowed percentage of deleted records for each member in the physical file. The percentage check is made when the member is closed. If the percentage of deleted records is greater than the value specified on this parameter, a message is sent to the system history log (QHST) to inform the user.
Top |
Specifies whether the space used by deleted data entries should be reclaimed by future insert requests.
Notes:
Top |
Specifies the sort sequence used for this file. The sort sequence is used with the LANGID and CCSID parameters to determine which sort sequence table is used.
Single values
Qualifier 1: Sort sequence
Qualifier 2: Library
Top |
Specifies the language identifier used when *LANGIDSHR or *LANGIDUNQ is specified on the SRTSEQ parameter. The language identifier is used with the SRTSEQ and CCSID parameters to determine which sort sequence table the file will use.
Top |
Specifies the coded character set identifier (CCSID) being used to describe character data in the fields of the file.
This parameter is applicable only if no value is specified for the Source file (SRCFILE) parameter and if a value is specified for the Record length (RCDLEN) parameter. If you specify a value other than the default value (*JOB) on this parameter, the SRCFILE parameter is not used, and a value must be specified for the RCDLEN parameter.
Note: A file created with no DDS when FILETYPE(*DATA) is specified has a CCSID of 65535, regardless of the job CCSID value.
Top |
Specifies whether records in this physical file can be updated.
Top |
Specifies whether records in this physical file can be deleted. Records in a logical file can be deleted only when the records in each physical file on which the logical file is based can be deleted.
Top |
Specifies whether the level identifiers of the record formats in the physical file are checked when the file is opened by a program.
Top |
Specifies a node group across which the file is to be distributed.
Single values
Qualifier 1: Node group
Qualifier 2: Library
Top |
Specifies the field, or set of fields, that is used as the partition key for distributing data. Up to 300 field names can be specified.
Note: This parameter is not valid if *NONE is specified for the Node group (NODGRP) parameter. If a node group name is specified for the NODGRP parameter, one or more field names must be specified.
Top |
Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.
Top |
Example 1: Creating a Physical File
CRTPF FILE(PAYLIB/PAYTXS) SRCFILE(SRCLIB/PAYTXS) MBR(*NONE) MAXMBRS(5)
This command creates a physical file named PAYTXS in the PAYLIB library. The source descriptions in the member PAYTXS in source file PAYTXS in the SRCLIB library are used to create the physical file. The file is created without members (*NONE was specified); therefore, no data can be put into the file until a member is added later. As many as five members can be contained in the file.
By default, each file member added later will contain data records. The access path of each member is continuously maintained. Each member can have up to 10,000 records before automatic extensions (three increments maximum) occur that add 1000 records to the capacity of the member. Storage space for each member is allocated only as needed, with no restrictions on whether the space is contiguous; there is no initial storage allocation. The public has object operational, read, add, delete, and update authority for the file.
Example 2: Creating a Physical File and Member
CRTPF FILE(ORDERCTL/ORDERS) SRCFILE(ORDERCTL/ORDERSRC) SRCMBR(MFGORD) MAXMBRS(50) SIZE(1000 100 5) ALLOCATE(*YES)
This command creates a physical file and physical file member, both named ORDERS in the ORDERCTL library. The file and its member are created from the MFGORD source member of the ORDERSRC source file in the same library. Storage space for the records placed in the file need not be contiguous. Up to 50 members can be contained in the file. The initial allocation of storage provides for up to 1000 records, and up to five increments of additional space for 100 records each can be added automatically. These allocation values also apply to each member of this physical file that is added later.
Top |
*ESCAPE Messages
Top |