CRTPF (Create Physical File)

CRTPF Command syntax diagram

 

Purpose

The Create Physical File (CRTPF) command creates a physical file in the database. A physical file is created from the file description parameters in the CRTPF command and (optionally) from a previously entered data description specification (DDS) source file that contains the source description of the file. 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

  1. A saved keyed physical file can contain up to 3999 members. A saved nonkeyed physical file can contain up to 7999 members. A single save operation can save up to 8000 objects. Information on how many internal objects are saved for each
  2. In multithreaded jobs, this command is not threadsafe for distributed files and fails for distributed files that use relational databases of type *SNA.
  3. The processing done for the *EVENTF value of the OPTION keyword is not threadsafe

OS/400 system object type is in the Backup and recovery topic in the Information Center.

 

Required Parameters

FILE
Specifies the qualified name of the file being created. If the file is used by a high-level language (HLL) program, the file name must be consistent with the naming rules of that language; otherwise, the file must be renamed in the program.

The name of the file can be qualified by one of the following library values:

*CURLIB: The 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 file is created.

physical-file-name: Specify the name of the physical file.

 

Optional Parameters

SRCFILE
Specifies the qualified name of the source file used when the physical file is created. The source file contains the specifications 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 Programming topic in the Information Center and DDS Reference topic in the Information Center.

If SRCFILE is specified, the RCDLEN parameter cannot be specified.

The name of the source file 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.

QDDSSRC: The source file, QDDSSRC, contains the DDS used to create the physical file.

source-file-name: Specify the name of the source file that contains the DDS used to create the physical file.

RCDLEN
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.

SRCMBR
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.

*FILE: The source file member name is the same as that of the physical file being created.

source-file-member-name: Specify the name of the member in the source file specified by SRCFILE used to create the physical file.

OPTION
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 underlined value is used.

Note: The underlined values for this parameter are similar to, but not actually default values, and therefore, cannot be changed with the CHGCMDDFT (Change Command Default) command.

Source Listing Options

*SRC or *SOURCE: A printout is created of the source statements used to create the file, and of errors that occur.

*NOSRC or *NOSOURCE: No printout of the source statements is created unless errors are detected. If errors are detected, they are listed along with the keyword or record format that caused the error.

Program Listing Options

*LIST: An expanded source printout is created, showing a detailed list of the file specifications that result from the source statements and references to other file descriptions.

*NOLIST: An expanded source printout is not created.

Second-Level Message Text Options

*NOSECLVL: The messages section of the DDS printout does not contain the second-level message for the errors found during DDS processing.

*SECLVL: Second-level message text is included in the source listing.

Event File Creation Options

*NOEVENTF: The compiler does not produce an event file for the CoOperative Development Environment/400 (CODE/400) product.

*EVENTF: The compiler produces an event file that can be used by the CODE/400 product. The event file is created as a member in the file EVFEVENT in your object library. The CODE/400 product uses this file to offer error feedback integrated with the CODE/400 editor. This value is normally specified by the CODE/400 product on your behalf.

SYSTEM
Specifies the system on which the physical file is created.

*LCL: The physical file is created on the local system.

*RMT: The physical file is created on a remote system using distributed data management (DDM). The physical file name specified on the FILE parameter must be the name of the DDM file (created using the CRTDDMF command). The DDM file contains the name of the physical file being created (RMTFILE parameter on the CRTDDMF command) and the name of the remote system (RMTLOCNAME parameter on the CRTDDMF command) on which the file is created.

*FILETYPE: If the name specified on the FILE parameter is a DDM file, the physical file is created on the remote system specified by CRTDDMF(RMTLOCNAME) for the DDM file. Otherwise, the name on the FILE parameter cannot be the same as an existing file, since a physical file of that name is created on the local system.

GENLVL
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.

Note: This parameter applies only to messages created while processing the DDS source. Messages created elsewhere in the file creation process are not affected by this parameter.

20: If errors occur in the DDS source file with a severity level greater than or equal to 20, the file is not created.

severity-level: Specify a severity level ranging from 0 through 30. The file is not created if the severity level specified for this parameter equals 0 or is less than the severity level that occurs in the data description specifications (DDS) source. This value must be greater than or equal to value specified on the FLAG parameter.

FLAG
Specifies the minimum severity level of messages to be listed in the DDS source listing.

0: The spooled file is owned by the original user profile of the job. If the job has switched to a new user profile, the original user profile is still the owner of the spooled file.

severity-level: Specify the minimum severity level of messages to be listed. Valid values range from 0 through 30. The severity level specified must be less than or equal to the severity level specified on the GENLVL parameter.

FILETYPE
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. More information on this parameter is in Commonly used parameters.

Note: FILETYPE(*SRC) is specified only when including DDS field definitions in the source file. Otherwise, use the Create Source Physical File (CRTSRCPF) command to create a source file.

*DATA: The physical file contains data records.

*SRC: The physical file contains source records.

MBR
Specifies the name of the physical file member added when the physical file is created. Other members can be added to the file after it is created by using the Add Physical File Member (ADDPFM) command.

*FILE: The member being added has the same name (specified in the FILE parameter) as the physical file that contains the member.

*NONE: No member is added when the file is created.

physical-file-member-name: Specify the name of the member added when the physical file is created.

EXPDATE
Specifies the expiration date. The files cannot be overwritten until the expiration date. The expiration date must be later than or equal to the current date.

Note: An attempt to open a file member that has an expiration date that has been exceeded causes an error message to be sent to the user. The RMVM command is used to remove the member from the file.

*NONE: No expiration date is specified.

expiration-date: Specify the date after which the physical file member is not used. The date must be in the format specified by the QDATFMT and QDATSEP job attributes. The date must be enclosed in apostrophes if special characters are used in the format.

MAXMBRS
Specifies the maximum number of members that the physical file being created can have at any time.

1: Only one member can be contained in the file.

*NOMAX: The system maximum is used.

maximum-members: Specify the value for the maximum number of members that the physical file can have. Valid values range from 1 through 32767.

ACCPTHSIZ
Specifies the maximum size of auxiliary storage that can be occupied by the following kinds of access paths:

  • The access paths that are associated with a physical file that has a keyed sequence access path.
  • The access paths that are created for referential or unique constraints, and that can be added to this file with the Add Physical File Constraint (ADDPFCST) command.

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.

*MAX1TB: The access paths associated with this file can occupy a maximum of one terabyte (1,099,511,627,776 bytes) of auxiliary storage.

Note: This value is not supported on releases of the system earlier than Version 3 Release 6 Modification 0 (V3R6M0). Therefore, if an attempt is made to save a physical file that has this attribute, and the save operation specifies a target release earlier than V3R6M0, the save operation might be unsuccessful, or if successful, the access paths are not saved. If the save operation is successful and the saved version of the file is then used to restore the physical file, the system rebuilds all of the access paths.

*MAX4GB: The access paths associated with this file can occupy a maximum of four gigabytes (4,294,966,272 bytes) of auxiliary storage. This value provides compatibility with releases of the operating system earlier than Version 3 Release 6 Modification 0.

MAINT
Specifies, for files with keyed sequence access paths only, the type of access path maintenance used for members of the physical file.

*IMMED: The access path is maintained for each physical file member whether the source physical file is opened or closed. The access path is changed whenever a record is updated, added to, or deleted from a member of this file or a logical file member based on a member of this file.

*REBLD: The access path is completely rebuilt when a file member is opened during the running of the program. The access path is continuously maintained until the member is closed; the access path maintenance is then ended. *REBLD is not valid for access paths that require unique key values.

*DLY: The maintenance of the access path is delayed until the physical file member is opened for use. Then, the access path is changed only for records that have been added, deleted, or changed since the file was last opened. While the file is open, changes made to its members are immediately reflected in the access paths of those members, no matter what is specified for MAINT. To prevent a lengthy rebuild time when the file is opened, *DLY should be specified only when the number of changes to the access path between successive opens are small; that is, when the file is opened frequently or when the key fields in records for this access path change infrequently. *DLY is not valid for access paths that require unique key values.

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.

RECOVER
Specifies, for files having immediate or delayed maintenance on their access paths, when recovery processing of the file is performed after a system failure has occurred while the access path was being changed. This parameter is valid only for a file with a keyed access path.

If *IMMED is specified for the 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 topic in the Information Center.

If *REBLD is specified for the MAINT parameter, the access path is rebuilt the next time its file is opened.

*NO: The access path of the file is not rebuilt during or after an IPL. The file's access path, if not valid, is rebuilt when the file is next opened.

Note: *NO is the default for all files that do not require unique keys.

*AFTIPL: The file's access path is rebuilt after the completion of the IPL. This option allows other jobs not using this file to start processing immediately after the completion of the IPL. If a job tries to allocate the file while its access path is being rebuilt, a file open exception occurs.

Note: *AFTIPL is the default for all files that require unique keys.

*IPL: The file's access path is rebuilt during the IPL. This ensures that the file's access path is rebuilt before the first user program tries to use it; however, no jobs can start running until after all files that specify RECOVER(*IPL) have their access paths rebuilt.

FRCACCPTH
Specifies, for files with keyed access paths only, whether access path changes are forced to auxiliary storage along with the associated records in the file whenever the access path is changed. 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.

*NO: The access path and changed records are not forced to auxiliary storage whenever the access path is changed.

*YES: The access path and changed records are forced to auxiliary storage whenever the access path is changed. If FRCACCPTH(*YES) is specified, MAINT(*REBLD) cannot be specified.

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.

SIZE
Specifies the initial number of records in each member of the file, the number of records in each increment that can be automatically added to the member size, and the number of times the increment can be 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.

A list of three values is specified to indicate the initial size of each member and the automatic extensions that can be added when needed, or *NOMAX can be specified. If SIZE is not specified, SIZE(10000 1000 3) is assumed by the system.

Element 1: Number of Records

Use one of the following to specify the initial number of records in the member before automatic extension of the member occurs. The ALLOCATE parameter determines when the required space for the initial number of records is allocated. If *YES is specified, the space is allocated when a new member is added. If *NO is specified, the initial space is allocated as determined internally by the system.

10000: Initially, up to 10,000 records can be inserted into each member of the file before any extension occurs.

number-of-records: Specify the number of records (ranging from 1 through 16777215) that can be inserted before an automatic extension occurs. If automatic extensions are not wanted, enter zeros for the second and third values in the list.

Element 2: Increment Value

Use one of the following to specify the number of records that can be additionally inserted in the member when the initial member size is exceeded and an automatic extension occurs. The minimum size of an increment is 10% of the size of the member at the time the maximum number of records is reached.

1000: The member size is increased by 10% or 1000 records, whichever is greater.

increment-value: Specify the number of additional records (ranging from 0 through 32767) which, if greater than 10% of the size of the member when the maximum number of records is reached, are to be added to the member during an automatic extension.

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%.

Specify 0 to prevent automatic extensions. This value must be 0 if the value for the number of increments is 0.

Element 3: Maximum Number of Increments

Use one of the following to specify the maximum number of increments that are automatically added to the member. If 0 is specified for the increment amount (element 2), the number of increments are not specified; 0 is the default value instead of 3 (a message is sent to the user issuing the command).

3: Up to three increments is automatically added to the member size.

number-of-increments: Specify the maximum number of increments, ranging from 0 through 32767, that are automatically added to the member. To prevent automatic extensions, specify a value of 0.

Other Single Values

*NOMAX: The system maximum is used.

ALLOCATE
Specifies whether storage space is allocated for the initial number of records (SIZE parameter) for each physical file member when it is added. The allocation provides enough space to hold the number of records specified by the 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.

*NO: When a new member is added, the system determines whether additional space is needed and allocates that amount.

*YES: The amount of storage space specified in the first value of the SIZE parameter is allocated each time a new member is added. If that amount of storage space is unavailable, the member is not added, and a message is sent to the user. If this parameter value is used, SIZE(*NOMAX) cannot be specified.

CONTIG
Specifies whether records in the initial allocation in each physical file member are stored contiguously (next to each other) on auxiliary storage. If so, and the necessary contiguous space is unavailable, the system sends a message to the job log and allocates the storage space noncontiguously. The file is still entirely usable. This parameter does not affect additional allocations that might be needed later, which would probably be noncontiguous.

*NO: The storage space for each member does not have to be contiguous.

*YES: The system allocates contiguous space for each member of the physical file being added. If it cannot, the user is notified and a message is put in the job log. The affected member is still added, even if the storage space is allocated noncontiguously. The member is just as usable in noncontiguous form. If *YES is specified for CONTIG, then ALLOCATE(*YES) must also be specified.

UNIT
This parameter is no longer supported. It exists solely for compatibility with releases earlier than Version 3 Release 6 Modification 0 of the AS/400 system. For information on using auxiliary storage pools (ASPs), refer to the Backup and recovery topic in the Information Center.

You can specify the value *ANY or a value ranging from 1 through 255 on this parameter. Specifies whether a file is stored on a specific auxiliary storage unit. The system attempts to allocate the storage space for the file and for all its members and their associated access paths on the specified unit. This includes the initial allocation when each member is added and any extensions that occur later for each member in the file. If the system cannot allocate the storage space for each member on the specified unit, it allocates the space on any available unit and sends a message to the job log. The file is entirely usable in all cases.

The unit identifier is a number ranging from 1 through 255, assigned when a new disk device is configured. The configured disk device can be shown and changed by using the Work with Disk Devices display from the Start System Services Tool (STRSST) command. More information on System Services Tool (SST) is in the Backup and recovery topic in the Information Center.

*ANY: The storage space for the file and its members is allocated on any available auxiliary storage unit.

unit-identifier: Specify the storage unit on which the system attempts to allocate the storage space for the file's access path.

If the unit specified is part of any user auxiliary storage pool (ASP) (ASP 2 through 16), the system allocates space from ASP 1, the system auxiliary storage pool.

FRCRATIO
Specifies the number of inserted, updated, or deleted records that are processed before they are forced to auxiliary (permanent) storage.

More information on this parameter is in Commonly used parameters. 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. More information on journal management is in the Journal management article in the Information Center.

*NONE: There is no force write ratio; the system determines when the records are written to auxiliary storage.

number-of-records-before-force: Specify the number of inserted, updated, or deleted records processed before being explicitly forced to auxiliary storage.

IGCDTA
Specifies whether the program-defined physical files can contain double-byte character set (DBCS) data.

Note: This parameter has no meaning with DDS files, because the use of DBCS data is specified in the DDS.

*NO: The file does not process DBCS data.

*YES: The file processes DBCS data.

Double-Byte Character Set Considerations:

If the user creates a physical file and specifies the RCDLEN parameter, the system creates a default record format.

  • If IGCDTA(*YES) is specified, the default record format can contain DBCS data (as if the record were specified with the DBCS-open (O in column 35 of DDS specification) data type).
  • If IGCDTA(*NO) is specified, the default record format cannot contain DBCS data (as if the record were specified with the character (A or blank in column 35 of DDS specification) data type).

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.

WAITFILE
Specifies the number of seconds that the program waits for the file resources and session resources to be allocated when the file is opened, or for the device or session resources to be allocated when an acquire operation is performed to the file. If those resources are not allocated within the specified wait time, an error message is sent to the program. More information on this parameter is in Commonly used parameters.

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 a program waits for the file resources to be allocated to the job. Valid values range from 1 through 32767 seconds.

WAITRCD
Specifies the number of seconds that a program waits for a record to be updated or deleted, or for a record read in the commitment control environment with LCKLVL(*ALL) specified. More information on record locking is in the Database Programming topic in the Information Center. If the record is not allocated in the specified wait time, an error message is sent to the program.

60: The program waits for 60 seconds.

*IMMED: The program does not wait; when a record is locked, an immediate allocation of the record is required.

*NOMAX: The system maximum is used.

number-of-seconds: Specify the number of seconds a program waits for the file resources to be allocated to the job. Valid values range from 1 through 32767 seconds.

SHARE
Specifies whether the open data path (ODP) for the physical file is shared with other programs in the routing step. When an ODP is shared, the programs accessing the file share facilities such as the file status and the buffer.

More information on shared database files is in the Database Programming topic in the Information Center.

*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, provided the scope specified on the OPNSCOPE keyword for the subsequent open of the file is compatible with the scope of the original open.

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.

DLTPCT
Specifies the maximum percentage of deleted records allowed for any member in the physical file. The percentage is based on the number of deleted records compared with the total record count in a member. The percentage check is made when a member of the file is closed or a logical file member based on a member of the file is closed. If the number of deleted records exceeds the percentage, a message is sent to the system history log (QHST) to inform the user.

*NONE: No percentage is specified; the number of deleted records in the file members is not checked when a member is closed.

deleted-records-threshold-percentage: Specify the largest percentage of deleted records in any member in the file. Valid values range from 1 through 100. If this percentage is exceeded, a message is sent to the system history log (QHST) when the file is closed.

REUSEDLT
Specifies whether the space used by deleted data entries is reclaimed by future insert requests.

Note: If a *YES value is specified for this parameter, the key ordering attribute for the physical file must be allowed to default or must be FCFO instead of FIFO or LIFO. If *YES is specified for this parameter, the key ordering attributes of FIFO and LIFO are not allowed.

*NO: The file does not reclaim space used by deleted data entries.

*YES: The file reclaims space used by deleted data entries. More information about the algorithm used to reclaim the deleted data is in the Database Programming topic in the Information Center.

SRTSEQ
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.

*SRC: The table specified in the data description specification (DDS) on the ALTSEQ keyword is used. If ALTSEQ is not used in the DDS, use the value specified for *JOB on this parameter.

*JOB: The sort sequence value used is the value for the job issuing this command to create the physical file.

*LANGIDSHR: The sort sequence table uses the same weight for multiple characters, and is the shared-weight sort sequence table associated with the language specified on the LANGID parameter.

*LANGIDUNQ: The sort sequence table must contain a unique weight for each character in the code page.

*HEX: A sort sequence table is not used. The hexadecimal values of the characters are used to determine the sort sequence.

The name of the table 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.

table-name: Specify a table name.

LANGID
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.

*JOB: The language identifier specified for the job is used.

language-identifier: Specify a language identifier.

CCSID
Specifies the coded character set identifier (CCSID) used to describe character data in the fields of the file. If this parameter is specified, the RCDLEN parameter and FILETYPE(*SRC) must also be specified.

A CCSID is a 16-bit number identifying a specific set of encoding scheme identifiers, character set identifiers, code page identifiers, and additional coding-related information that uniquely identifies the coded graphic representation used.

*JOB: The current job's default CCSID is used.

*HEX: The CCSID 65535 is used, which indicates that the character data in the fields is treated as bit data and is not converted.

coded-character-set-identifier: Specify the CCSID to be used. More information on valid CCSIDs is in the Globalization topic in the Information Center.

ALWUPD
Specifies whether records can be updated in the physical file. Records in a logical file can be updated only when the records in each physical file, on which the logical file is based, can be updated.

*YES: Records can be updated in the physical file.

*NO: Records cannot be updated in this physical file or in any logical file built over this physical file.

ALWDLT
Specifies whether records can be deleted from the physical file. 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.

*YES: Records can be deleted in this physical file.

*NO: Records cannot be deleted in this physical file or from any logical file built over this physical file.

LVLCHK
Specifies whether the record format level identifiers in the program are checked against those in the logical file when the file is opened. If so, the record format identifiers in the program must match those in the logical file. This value can be overridden by the Override with Database File (OVRDBF) command at run time.

*YES: The level identifiers of the record formats are checked when the file is opened. If the level identifiers do not match, an error message is sent to the program requesting the open, and the file is not opened.

*NO: The level identifiers are not checked when the file is opened.

AUT
Specifies the authority given to users who do not have specific authority to the physical file, who are not on an authorization list, and whose user group has no specific authority to the physical file. More information on this parameter is in Commonly used parameters.

*LIBCRTAUT: The public authority for the physical file is taken from the value on the CRTAUT parameter of the target library (the library that is to contain the physical file). The public authority is determined when the physical file is created. If the CRTAUT value for the library changes after the physical file is created, the new value does not affect any existing objects.

*CHANGE: The user can perform all operations on the physical 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 physical 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 physical file.

*USE: The user can perform basic operations on the physical file, such as running a program or reading a file. The user cannot change the physical file. *USE authority provides object operational authority, read authority, and execute authority.

*EXCLUDE: The user cannot access the physical file.

authorization-list-name: Specify the name of the authorization list used.

NODGRP
Specifies the name of a node group across which the file is distributed.

*NONE: The file is not a distributed file. All data associated with the file is on the local system.

The name of the node group 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.

node-group-name: Specify the name of a node group associated with this file.

PTNKEY
Specifies the field, or set of fields, that is used as the partition key for distributing data. Up to 300 names can be specified.

Note: This parameter is not valid when NODGRP(*NONE) is specified. If a node group name is specified (NODGRP parameter), one or more field names must be specified.

partition-key-field-name: Specify the name of a field to be used to define the partition key.

TEXT
Specifies the text that briefly describes the physical file. More information on this parameter is in Commonly used parameters.

*SRCMBRTXT: The text is taken from the source file member being used to create the physical file. If the source file is a database file, the text is taken from the source member. Text can be added or changed for a database source member by using the Source Entry Utility or by using either the Add Physical File Member (ADDPFM) command or the Change Physical File Member (CHGPFM) command. If the source file is an inline file or a device file, the text is blank.

*BLANK: Text is not specified.

'description': Specify no more than 50 characters of text, enclosed in apostrophes.

Examples for CRTPF

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.

Error messages for CRTPF

*ESCAPE Messages

CPF3204
Cannot find object needed for file &1 in &2.
CPF323C
QRECOVERY library could not be allocated.
CPF5702
File either not DDM file or not found.
CPF7302
File &1 not created in library &2.