Command reference / db
CRTPF
Create Physical File
Creates a physical file from the parameters on this command and, optionally, from the DDS in a source file. Data records are grouped into members, and each member has its own access path. A DDS source file is not needed when the record format has only one character field in arrival sequence, or when the file is a source file. Use OVRDBF to override attributes before open, and CHGPF to change them afterward.
Allowed environments: *ALL.
Positional parameters: 5.
Restrictions
- Conditionally threadsafe. In multithreaded jobs it is not threadsafe for distributed files, and it fails for distributed files that use relational databases of type *SNA.
Parameters
FILE
File
Names the physical file to create. This parameter is required.
*CURLIB- The job's current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
File
File
Library
Library
Suggested / special values:
*CURLIB
SRCFILE
Source file
Names the source file holding the DDS that describes the record format, fields and access paths. Cannot be combined with RCDLEN.
*LIBL- Search the library list for the source file's library.
*CURLIB- Use the job's current library, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Source file
Source file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SRCMBR
Source member
Names the source member that holds the DDS. Cannot be specified with RCDLEN.
Suggested / special values:
*FILE
*FILE- Use the same name as the physical file.
RCDLEN
Record length, if no DDS
Sets the record length in bytes. With FILETYPE(*DATA) it creates a single-field record format. Allowed range is 1 through 32766.
GENLVL
Generation severity level
Severity at or above which DDS processing errors cause the create to fail. Must be greater than or equal to FLAG.
FLAG
Flagging severity level
Minimum severity of DDS messages to list. Must be less than or equal to GENLVL.
FILETYPE
File type
Whether each member holds data records or source statements.
Allowed values:
*DATA, *SRC
*DATA- Members contain data records.
*SRC- Members contain source statements.
MBR
Member, if desired
Names the member added when the file is created.
Suggested / special values:
*FILE, *NONE
*FILE- The member has the same name as the file.
*NONE- No member is added.
IGCDTA
User specified DBCS data
For program-described files, whether the file processes DBCS data. For DDS-described files, DBCS attributes come from the DDS.
Allowed values:
*NO, *YES
*NO- The file does not contain DBCS data.
*YES- The file contains DBCS data.
TEXT
Text 'description'
Describes the object in up to 50 characters.
Suggested / special values:
*SRCMBRTXT, *BLANK
*SRCMBRTXT- Take the text from the source member.
*BLANK- No text.
OPTION
Source listing options
Controls the output produced when the file is created. Up to four values can be given.
Allowed values:
*SRC, *NOSRC, *SOURCE, *NOSOURCE, *LIST, *NOLIST, *SECLVL, *NOSECLVL, *EVENTF, *NOEVENTF
*SRC- Print source statements and any errors.
*SOURCE- Same as *SRC.
*NOSRC- Print source only when errors are found.
*NOSOURCE- Same as *NOSRC.
*LIST- Print an expanded source listing.
*NOLIST- No expanded listing.
*SECLVL- Include second-level message help in the DDS printout.
*NOSECLVL- Omit second-level message help.
*EVENTF- Create an event file for CODE tooling.
*NOEVENTF- No event file.
SYSTEM
System
Whether the physical file is created on the local or a remote system.
Allowed values:
*LCL, *RMT, *FILETYPE
*LCL- Create on the local system.
*RMT- Create on a remote system; FILE must name a DDM file.
*FILETYPE- Local if FILE does not exist, otherwise FILE must be a DDM file.
EXPDATE
Expiration date for member
Date after which the member cannot be used.
Suggested / special values:
*NONE
*NONE- No expiration date.
MAXMBRS
Maximum members
Maximum number of members the physical file can contain.
Suggested / special values:
*NOMAX
*NOMAX- The system maximum of 32,767 members.
ACCPTHSIZ
Access path size
Maximum auxiliary storage that keyed-sequence and constraint access paths for this file can occupy.
Allowed values:
*MAX1TB, *MAX4GB
*MAX1TB- Up to 16 terabytes.
*MAX4GB- Up to 4 gigabytes.
PAGESIZE
Access path logical page size
Logical page size used when the access path is created. It determines the size of each index page moved between disk and memory.
Allowed values:
*KEYLEN
*KEYLEN- Size chosen from the total key length; minimum 32K.
MAINT
Access path maintenance
For files with key fields, how the access path is maintained for all members.
Allowed values:
*IMMED, *DLY, *REBLD
*IMMED- Updated on each add, change or delete; required for unique keys.
*DLY- Maintenance delayed until the member is opened; not valid for unique keys.
*REBLD- Rebuilt on each open and deleted on close; not valid for unique keys.
RECOVER
Access path recovery
When recovery runs if the access path is being changed at a system failure. Valid only for a keyed access path.
Allowed values:
*NO, *AFTIPL, *IPL
*NO- Rebuilt when the file is opened; default for files without unique keys.
*AFTIPL- Rebuilt after IPL completes; default for files with unique keys.
*IPL- Rebuilt during IPL, before user jobs start.
FRCACCPTH
Force keyed access path
Whether access path changes are forced to auxiliary storage together with the records.
Allowed values:
*NO, *YES
*NO- Not forced.
*YES- Forced; cannot be combined with MAINT(*REBLD).
SIZE
Member size
Initial number of records per member, number of records per increment, and maximum number of increments.
*NOMAX- No user limit on records; requires ALLOCATE(*NO).
Elements in order
Initial number of records
Initial number of records
Increment number of records
Increment number of records
Maximum increments
Maximum increments
ALLOCATE
Allocate storage
Whether initial storage is allocated to each member added to the file.
Allowed values:
*NO, *YES
*NO- The system decides the allocation.
*YES- Allocate the initial SIZE amount for each new member.
CONTIG
Contiguous storage
Whether the records in the initial allocation must be stored next to each other.
Allowed values:
*NO, *YES
*NO- Contiguous storage not required.
*YES- Required; if not possible, the member is added and a message is sent.
UNIT
Preferred storage unit
Preferred storage media for the file.
Suggested / special values:
*ANY, *SSD
*ANY- Any available storage media.
*SSD- Solid state disk preferred.
FRCRATIO
Records to force a write
Number of inserted or updated records processed before they are forced to auxiliary storage. Use a large number or *NONE for journaled files.
Suggested / special values:
*NONE
*NONE- No force ratio; the system decides.
WAITFILE
Maximum file wait time
Seconds the program waits for file resources at open, or for device or session resources at acquire.
Suggested / special values:
*IMMED, *CLS
*IMMED- Do not wait.
*CLS- Use the job default wait time.
WAITRCD
Maximum record wait time
Seconds the program waits for a record being changed or deleted.
Suggested / special values:
*IMMED, *NOMAX
*IMMED- Do not wait.
*NOMAX- The system maximum of 32,767 seconds.
SHARE
Share open data path
Whether the open data path is shared with other programs in the same routing step.
Allowed values:
*NO, *YES
*NO- Not shared; a new ODP is created on each open.
*YES- Shared with each program in the job that also specifies *YES.
DLTPCT
Max % deleted records allowed
Largest allowed percentage of deleted records per member. A message goes to QHST if exceeded.
Suggested / special values:
*NONE
*NONE- Not checked.
REUSEDLT
Reuse deleted records
Whether space from deleted records is reclaimed by later inserts.
Allowed values:
*NO, *YES
*YES- Reclaim deleted record space.
*NO- Do not reclaim it.
SRTSEQ
Sort sequence
Sort sequence for the file. Used with LANGID and CCSID to choose the sort table.
*SRC- Use the ALTSEQ table from the DDS, else the *JOB value.
*JOB- Use the job's sort sequence.
*LANGIDSHR- Shared weighted table for the LANGID language.
*LANGIDUNQ- Table with a unique weight for each character.
*HEX- No table; hexadecimal values determine sequence.
*LIBL- Search the library list for the table.
*CURLIB- Search the job's current library.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Sort sequence
Sort sequence
Library
Library
Suggested / special values:
*LIBL, *CURLIB
LANGID
Language ID
Language identifier used with *LANGIDSHR or *LANGIDUNQ.
Suggested / special values:
*JOB
*JOB- The job's language identifier.
CCSID
Coded character set ID
CCSID describing the character data in the file's fields. Applies only when SRCFILE is not specified and RCDLEN is.
Suggested / special values:
*JOB, *HEX
*JOB- The job's default CCSID.
*HEX- CCSID 65535, treated as bit data and not converted.
ALWUPD
Allow update operation
Whether records in this file can be updated.
Allowed values:
*YES, *NO
*YES- Records can be updated.
*NO- No updates, directly or through any logical file.
ALWDLT
Allow delete operation
Whether records in this file can be deleted.
Allowed values:
*YES, *NO
*YES- Records can be deleted.
*NO- No deletes, directly or through any logical file.
LVLCHK
Record format level check
Whether record format level identifiers are checked when a program opens the file.
Allowed values:
*YES, *NO
*YES- Checked; a mismatch sends an open error message.
*NO- Not checked.
NODGRP
Node group
Node group across which the file is distributed.
*NONE- Not distributed; all data is local.
*LIBL- Search the library list for the node group.
*CURLIB- Search the thread's current library.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Node group
Node group
Library
Library
Suggested / special values:
*LIBL, *CURLIB
PTNKEY
Partitioning Key
Field or fields used as the partition key for distributing data; up to 300. Not valid when NODGRP(*NONE).
AUT
Authority
Authority given to users with no specific authority, who are not on an authorization list, and whose group profiles have no specific authority.
Suggested / special values:
*LIBCRTAUT, *ALL, *CHANGE, *EXCLUDE, *USE
*LIBCRTAUT- Take the CRTAUT value of the library.
*ALL- All operations except authorization list management.
*CHANGE- All data authority and most operations, except owner-limited ones.
*USE- Basic operations such as reading; cannot change the object.
*EXCLUDE- No access.
Examples
CRTPF FILE(PAYLIB/PAYTXS) SRCFILE(SRCLIB/PAYTXS) MBR(*NONE) MAXMBRS(5)
Creates physical file PAYTXS in PAYLIB from the DDS in member PAYTXS of source file PAYTXS in SRCLIB. No member is added, so none exists until one is added later; up to five members are allowed.
CRTPF FILE(ORDERCTL/ORDERS) SRCFILE(ORDERCTL/ORDERSRC) SRCMBR(MFGORD) MAXMBRS(50) SIZE(1000 100 5) ALLOCATE(*YES)
Creates file and member ORDERS in ORDERCTL from member MFGORD of ORDERSRC. Up to 50 members are allowed, storage is initially allocated for 1000 records, and up to five automatic increments of 100 records each are added.
Generated from os/cl/catalog/CRTPF.json and os/cl/help/CRTPF.json.