Command reference / file
CRTSRCPF
Create Source Physical File
Creates a source physical file. Such a file holds source data for objects like CL programs (CL source statements) and DDS used to create database or device files. The file can hold one or more members, up to the number set by the MAXMBRS parameter.
Allowed environments: *ALL.
Positional parameters: 3.
Restrictions
- The command is conditionally threadsafe. In a multithreaded job it is not threadsafe and fails for *SNA-type DDM files when SYSTEM(*RMT) or SYSTEM(*FILETYPE) is specified.
Parameters
FILE
File
Names the source physical file to create and the library where it is located. This parameter is required.
*CURLIB- Uses the current library of the job, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)
File
File
Library
Library
Suggested / special values:
*CURLIB
RCDLEN
Record length
Sets the bytes per record, from 13 to 32766. The length must include 6 bytes for the sequence number and 6 bytes for the date. With IGCDTA(*YES) the valid range is 16 to 32766.
MBR
Member, if desired
Names the member added when the file is created.
Suggested / special values:
*NONE, *FILE
*NONE- No member is added when the file is created.
*FILE- The member gets the same name as the file.
IGCDTA
User specified DBCS data
Declares whether the file contains DBCS data. With *YES, RCDLEN must be at least 16.
Allowed values:
*NO, *YES
*NO- The file does not contain DBCS data.
*YES- The file contains DBCS data.
TEXT
Text 'description'
Briefly describes the object, using up to 50 characters enclosed in apostrophes.
Suggested / special values:
*BLANK
*BLANK- No text is specified.
SYSTEM
System
Selects local or remote creation. Remote creation uses a DDM file specified by FILE.
Allowed values:
*LCL, *RMT, *FILETYPE
*LCL- Create locally; FILE must not exist.
*RMT- Create on the remote system identified by the DDM file.
*FILETYPE- Create locally if FILE does not exist; otherwise FILE must be a DDM reference to the remote file.
EXPDATE
Expiration date for member
Sets the date after which the member added during creation cannot be used.
Suggested / special values:
*NONE
*NONE- The new member does not expire.
MAXMBRS
Maximum members
Sets the maximum number of members the file can contain, from 1 to 32767.
Suggested / special values:
*NOMAX
*NOMAX- The system maximum of 32,767 members applies.
ACCPTHSIZ
Access path size
Limits storage for keyed access paths associated with the source physical file.
Allowed values:
*MAX1TB, *MAX4GB
*MAX1TB- Allow up to sixteen terabytes, as documented for IBM i 7.5 despite the historical value name.
*MAX4GB- Allow up to four gigabytes.
PAGESIZE
Access path logical page size
Selects the logical index page size.
Allowed values:
*KEYLEN, 8, 16, 32, 64, 128, 256, 512
8- Compatibility value interpreted as 32K.
16- Compatibility value interpreted as 32K.
32- Use 32K pages.
64- Use 64K pages.
128- Use 128K pages.
256- Use 256K pages.
512- Use 512K pages.
*KEYLEN- Determine page size from key length, with a 32K minimum.
ACCPTH
Access path type
Selects the access path used by all file members.
Allowed values:
*ARRIVAL, *KEYED
*ARRIVAL- Use arrival sequence.
*KEYED- Use keyed sequence.
MAINT
Access path maintenance
Controls when access paths reflect record changes.
Allowed values:
*IMMED, *DLY, *REBLD
*IMMED- Update the access path for every record change.
*DLY- Save changes while closed and apply them on open; sufficiently many changes cause a full rebuild.
*REBLD- Rebuild on each open and delete the access path on close.
RECOVER
Access path recovery
Controls keyed access path recovery after failure for immediate or delayed maintenance.
Allowed values:
*NO, *AFTIPL, *IPL
*NO- Rebuild when the file is next opened.
*AFTIPL- Rebuild after IPL; jobs can start while the access path is rebuilt.
*IPL- Rebuild during IPL before user jobs start.
FRCACCPTH
Force keyed access path
Controls forcing changed access paths to storage together with records.
Allowed values:
*NO, *YES
*NO- Do not force access path changes with records.
*YES- Force access path and record changes together; invalid with MAINT(*REBLD).
SIZE
Member size
Sets initial records (default 10000), increment records (1000), and maximum increments (499). Deleted records count. An increment is at least 10% unless zero; zero increments require a zero increment size.
Suggested / special values:
*NOMAX
*NOMAX- Use the system member-size limit; requires ALLOCATE(*NO).
Elements in order
Initial number of records
Initial number of records
Increment number of records
Increment number of records
Maximum number of increments
Maximum number of increments
ALLOCATE
Allocate storage
Controls initial storage allocation for each member.
Allowed values:
*NO, *YES
*NO- Let the system determine initial allocation.
*YES- Allocate the initial SIZE record capacity; SIZE(*NOMAX) is invalid.
CONTIG
Contiguous storage
The IBM i 7.5 parameter table retains CONTIG for compatibility but provides no separate explanatory section.
Allowed values:
*NO, *YES
*NO- Default table choice.
*YES- Alternate table choice.
UNIT
Preferred storage unit
Selects preferred storage media, without guaranteeing placement.
Suggested / special values:
*ANY, *SSD
*ANY- No media preference; numeric 1 through 254 have the same meaning.
*SSD- Prefer solid state storage if available; numeric 255 has the same meaning.
FRCRATIO
Records to force a write
Sets how many inserted or updated records are processed before records are forced to auxiliary storage.
Suggested / special values:
*NONE
*NONE- Let the system determine when records are written.
WAITFILE
Maximum file wait time
Sets the file-resource allocation wait in seconds, from 1 through 32767.
Suggested / special values:
*IMMED, *CLS
*IMMED- Require immediate allocation.
*CLS- Use the job default wait time.
WAITRCD
Maximum record wait time
Sets the record-lock wait in seconds for change or delete, from 1 through 32767; the default is 60.
Suggested / special values:
*IMMED, *NOMAX
*IMMED- Require immediate allocation.
*NOMAX- Wait the system maximum of 32767 seconds.
SHARE
Share open data path
Controls sharing of file state and buffers within a routing step. Cannot be specified with MBR(*NONE).
Allowed values:
*NO, *YES
*NO- Create a separate open data path for each open.
*YES- Share with programs in the job that also request sharing.
DLTPCT
Max % deleted records allowed
Sets a percentage from 1 through 100. On member close, exceeding it sends a job-log message.
Suggested / special values:
*NONE
*NONE- Do not check the deleted-record percentage.
CCSID
Coded character set ID
Sets the CCSID used to describe character data in the file's fields. Any integer CCSID can be specified.
Suggested / special values:
*JOB, *HEX
*JOB- Uses the current job's default CCSID.
*HEX- Uses CCSID 65535, so character data is treated as bit data and is not converted.
ALWUPD
Allow update operation
Controls whether records in the file can be changed.
Allowed values:
*YES, *NO
*YES- Allow record updates.
*NO- Disallow record updates.
ALWDLT
Allow delete operation
Controls whether records in the file can be deleted.
Allowed values:
*YES, *NO
*YES- Allow record deletion.
*NO- Disallow record deletion.
AUT
Authority
Sets the authority given to users who have no specific authority to the file, are not on an authorization list, and whose group profiles have no specific authority.
Suggested / special values:
*LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE
*LIBCRTAUT- Uses the CRTAUT value of the library where the file is created.
*CHANGE- All operations except those limited to the owner or to OBJEXIST and OBJMGT authority.
*ALL- All operations except those limited to AUTLMGT authority, including changing ownership.
*USE- Basic operations such as reading the file, but no changes.
*EXCLUDE- The user cannot access the file.
Examples
CRTSRCPF FILE(SRCLIB/PAYTXS)
Creates source file PAYTXS in library SRCLIB with no members. Up to 32,767 members can be added later. Public users get object operational, read, add, delete, and update authority.
CRTSRCPF FILE(ORDERCTL/ORDERS) MBR(*FILE) SIZE(100 50 5)
Creates source file ORDERS in library ORDERCTL with a member also named ORDERS. The member starts at 100 records and can grow by up to five increments of 50 records. These size values also apply to members added later.
Generated from os/cl/catalog/CRTSRCPF.json and os/cl/help/CRTSRCPF.json.