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

Parameters

FILE File

Names the source physical file to create and the library where it is located. This parameter is required.

Type
*QUAL
Required
Yes
Case
Uppercase
*CURLIB
Uses the current library of the job, or QGPL if none is set.
Qualified parts (object, then library; write LIBRARY/OBJECT)

File File

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*CURLIB
Length
10
Case
Uppercase

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.

Type
*INT4
Required
No
Default
92
Range
13 to 32766
Case
Uppercase

MBR Member, if desired

Names the member added when the file is created.

Type
*NAME
Required
No
Default
*NONE
Length
10
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*BLANK
Length
50
Case
Mixed case

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.

Type
*CHAR
Required
No
Default
*LCL
Length
9
Case
Uppercase

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.

Type
*DATE
Required
No
Default
*NONE
Case
Uppercase

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.

Type
*INT4
Required
No
Default
*NOMAX
Range
1 to 32767
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*MAX1TB
Length
9
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*KEYLEN
Length
7
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*ARRIVAL
Length
8
Case
Uppercase

Allowed values: *ARRIVAL, *KEYED

*ARRIVAL
Use arrival sequence.
*KEYED
Use keyed sequence.

MAINT Access path maintenance

Controls when access paths reflect record changes.

Type
*CHAR
Required
No
Default
*IMMED
Length
6
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NO
Length
7
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

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.

Type
*ELEM
Required
No
Case
Uppercase

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

Type
*INT4
Required
No
Default
10000
Range
1 to 2147483646
Case
Uppercase

Increment number of records Increment number of records

Type
*INT4
Required
No
Default
1000
Range
0 to 2147483647
Case
Uppercase

Maximum number of increments Maximum number of increments

Type
*INT4
Required
No
Default
499
Range
0 to 32767
Case
Uppercase

ALLOCATE Allocate storage

Controls initial storage allocation for each member.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

Allowed values: *NO, *YES

*NO
Default table choice.
*YES
Alternate table choice.

UNIT Preferred storage unit

Selects preferred storage media, without guaranteeing placement.

Type
*INT2
Required
No
Default
*ANY
Range
1 to 255
Case
Uppercase

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.

Type
*INT4
Required
No
Default
*NONE
Case
Uppercase

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.

Type
*INT2
Required
No
Default
*IMMED
Range
1 to 32767
Case
Uppercase

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.

Type
*INT2
Required
No
Default
60
Range
1 to 32767
Case
Uppercase

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

Type
*CHAR
Required
No
Default
*NO
Length
4
Case
Uppercase

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.

Type
*INT2
Required
No
Default
*NONE
Range
1 to 100
Case
Uppercase

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.

Type
*INT4
Required
No
Default
*JOB
Range
1 to 65535
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*YES
Length
4
Case
Uppercase

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.

Type
*NAME
Required
No
Default
*LIBCRTAUT
Length
10
Case
Uppercase

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.

IBM command documentation

Generated from os/cl/catalog/CRTSRCPF.json and os/cl/help/CRTSRCPF.json.