Create Source Physical File (CRTSRCPF)

Where allowed to run: All environments (*ALL)
Threadsafe: Conditional
Parameters
Examples
Error messages

The Create Source Physical File (CRTSRCPF) command creates a source physical file.

A source physical file contains source data needed to create objects such as control language (CL) source statements, which are used to create a CL program, or data description specifications (DDS) which (in turn) are used to create a database or device file.

A source physical file can have one or more members. The maximum number of members that can be added to the file is specified for the Maximum members (MAXMBRS) parameter.

Restrictions:

Top


 

Parameters

Keyword Description Choices Notes
FILE File Qualified object name Required, Positional 1
Qualifier 1: File Name
Qualifier 2: Library Name, *CURLIB
RCDLEN Record length Integer, 92 Optional, Positional 2
MBR Member, if desired Name, *NONE, *FILE Optional, Positional 3
IGCDTA User specified DBCS data *NO, *YES Optional
TEXT Text 'description' Character value, *BLANK Optional
SYSTEM System *LCL, *RMT, *FILETYPE Optional
EXPDATE Expiration date for member Date, *NONE Optional
MAXMBRS Maximum members Integer, *NOMAX Optional
ACCPTHSIZ Access path size *MAX1TB, *MAX4GB Optional
PAGESIZE Access path logical page size *KEYLEN, 8, 16, 32, 64, 128, 256, 512 Optional
ACCPTH Access path type *ARRIVAL, *KEYED 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, 499
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, *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
CCSID Coded character set ID Integer, *JOB, *HEX Optional
ALWUPD Allow update operation *YES, *NO Optional
ALWDLT Allow delete operation *YES, *NO Optional
AUT Authority Name, *LIBCRTAUT, *ALL, *CHANGE, *EXCLUDE, *USE Optional

Top

 

File (FILE)

Specifies the source physical file to be created.

If the file is used in a high-level language program, the file name must be consistent with the naming rules of that language. Otherwise, the file must be renamed in the program.

This is a required parameter.

Qualifier 1: File

name

Specify the name of the source physical file.

Qualifier 2: Library

*CURLIB

The current library for the job is used to locate the file. If no library is specified as the current library for the job, QGPL is used.

name

Specify the library where the file is located.

Top

 

Record length (RCDLEN)

Specifies the number of bytes in the length of the records stored in the source physical file. The record format contains three fields: the source sequence number, the date, and the source statement.

This parameter must provide 12 positions for the source sequence number and date fields required in each record. These fields are defined with fixed attributes and names, and they have a keyed access path over the sequence number.

92

The record length is 92 bytes. The source sequence number contains 6 bytes, the date contains 6 bytes, and the source statement contains 80 bytes.

integer

Specify the record length of each source record in the file. The value must include 6 bytes for the source sequence number and 6 bytes for the date. Valid values range from 13 through 32766 bytes.

Double-Byte Character Set Considerations

If IGCDTA(*YES) is specified, the RCDLEN parameter must provide six positions for the source sequence number, six positions for the date field, and at least four positions for source start. Valid values for a double-byte character set (DBCS) range from 16 through 32766.

Top

 

Member (MBR)

Specifies the source file member to be added when the file is created.

*NONE

No member is added when the file is created.

*FILE

The name of the member to be added is the same as the name specified for the File (FILE) parameter.

name

Specify the name of the member to be added.

Top

 

User specified DBCS data (IGCDTA)

Specifies whether the file contains double-byte character set (DBCS) data.

*NO

The file does not contain DBCS data.

*YES

The file contains DBCS data.

Top

 

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*BLANK

No text is specified.

character-value

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

Top

 

System (SYSTEM)

Specifies whether the source physical file is created on the local system or the remote system.

*LCL

The source physical file is created on the local system. The file specified for the File (FILE) parameter must not already exist on the system.

*RMT

The source physical file is created on a remote system. The file specified for the FILE parameter must be the name of a DDM file that identifies the remote system and the name of the source physical file being created.

*FILETYPE

If the file specified for the FILE parameter does not exist on the system, the source physical file is created on the local system. Otherwise, the file on the FILE parameter must be a DDM file, and the source physical file is created on a remote system. The DDM file identifies the remote system and the name of the source physical file being created.

Top

 

Expiration date for member (EXPDATE)

Specifies, if a source file member is added when the source physical file is created, the expiration date of the source file member.

*NONE

The member being added to the file has no expiration date.

date

Specify the date after which the member being added cannot be used.

Top

 

Maximum members (MAXMBRS)

Specifies the maximum number of members that the source physical file can contain.

*NOMAX

The number of members that can be contained in the file is the system maximum of 32,767 members.

intefer

Specify the maximum number of members that can be contained in the file. Valid values range from 1 through 32767 members.

Top

 

Access path size (ACCPTHSIZ)

Specifies the maximum size of auxiliary storage that can be occupied by access paths that are associated with keyed source physical files. This parameter does not apply to access paths that are created for logical files or for queries that refer to the data in a source 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.

*MAX4GB

The access paths associated with this file can occupy a maximum of four gigabytes (4,294,966,272 bytes) of auxiliary storage.

Top

 

Access path logical page size (PAGESIZE)

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.

*KEYLEN

The access path logical page size will be determined by the total length of the key, or keys.

8

Logical page size of 8k.

16

Logical page size of 16k.

32

Logical page size of 32k.

64

Logical page size of 64k.

128

Logical page size of 128k.

256

Logical page size of 256k.

512

Logical page size of 512k.

Top

 

Access path type (ACCPTH)

Specifies the type of access path used by all the members in the source physical file.

*ARRIVAL

The access path is an arrival sequence access path.

*KEYED

The access path is a keyed sequence access path.

Top

 

Access path maintenance (MAINT)

Specifies the type of access path maintenance used for all members of the source physical file.

*IMMED

The access path is updated each time a record is changed, added, or deleted from a member.

*REBLD

The access path is completely rebuilt each time a file member is opened. The access path is maintained until the member is closed. Then the access path is deleted.

*DLY

The maintenance of the access path is delayed until the physical file member is opened for use. 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, all changes made to its members are immediately reflected in the access path of those members, no matter what is specified for the MAINT parameter. 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 is small.

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

 

Access path recovery (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 occurs while the access path is being changed. This parameter is valid only for files with a keyed access path.

If *IMMED or *DLY 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), after IPL has ended (during concurrent job running), 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 paths that must be recovered and what the RECOVER parameter value is for each path. The user can override the RECOVER parameter value on this display. More information 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.

*NO

The access path of the file is rebuilt when the file is opened. *NO is the default for all files that do not require unique keys.

*AFTIPL

The access path of the file is rebuilt after the initial program load (IPL) operation is completed. This option allows other jobs not using this file to start processing immediately after the completion of IPL. If a job tries to allocate the file while its access path is being rebuilt, a file open exception occurs. *AFTIPL is the default for files that require unique keys.

*IPL

The access path of the file is rebuilt during the IPL operation. 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.

Top

 

Force keyed access path (FRCACCPTH)

Specifies whether access path changes are forced to auxiliary storage along with the associated records in the source physical file.

*NO

The access path and the associated records are not written to auxiliary storage whenever the access path is changed.

*YES

The access path and the associated records are written to auxiliary storage whenever the access path is changed. *YES cannot be specified if *REBLD is specified for the Access path maintenance (MAINT) parameter.

Top

 

Member size (SIZE)

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

*NOMAX

The number of records that can be added to each member of the file is not limited by the user. The maximum size of each member is determined by the system. If *NOMAX is specified, *NO must be specified for the Allocate storage (ALLOCATE) parameter.

Element 1: Initial number of records

Specify the initial number of records in each member.

10000

Initially, up to 10000 records can be written to each member of the file.

1-2147483646

Specify the number of records that can be written to each member of the file before the member size is automatically extended.

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.

1000

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

integer

Specify the number of additional records which, if greater than 10% of the size of the member when the maximum number of records is reached, are automatically added to the member.

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.

499

A maximum of 499 increments is automatically added to the member size.

integer

Specify the maximum number of increments automatically added to the member size. Valid values range from 0 through 32767. If 0 is specified, the member is not automatically extended.

Top

 

Allocate storage (ALLOCATE)

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.

*NO

The system determines the amount of storage space to allocate to each member added to the file.

*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 *YES is specified, *NOMAX must not be specified for the SIZE parameter.

Top

Top

 

Preferred storage unit (UNIT)

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

 

Records to force a write (FRCRATIO)

Specifies the number of inserted or updated records that are processed before the records are forced into auxiliary storage.

The force write ratio specified for a logical file cannot be less than or equal to the smallest force write ratio of its based-on files. If a larger force write ratio is specified, it is ignored and a message is sent informing the user of the action.

For example, if the force ratios of three physical files are 2, 6, and 8, the logical file force ratio that is based on these three physical files must be as restrictive as the least of them; that is 2 in this case. Two would be used even if the FRCRATIO parameter is not specified. Thus, each time a program inserts, updates, or deletes two records in the logical file (regardless of which based-on physical files are affected), those records are forced to permanent storage.

If a physical file associated with this logical file is being journaled, a large force write ratio or *NONE is specified. More information on journal management is in the Backup and Recovery book, SC41-5304.

*NONE

There is no specified force ratio. The system determines when the records are written to auxiliary storage.

integer

Specify the number of inserted or updated records that are processed before the records are written to auxiliary storage.

Top

 

Maximum file wait time (WAITFILE)

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.

*IMMED

The program does not wait. Immediate allocation of file resources is required.

*CLS

The job default wait time is used as the wait time for the file resources to be allocated.

1-32767

Specify the number of seconds to wait for file resources to be allocated.

Top

 

Maximum record wait time (WAITRCD)

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.

60

The program waits for 60 seconds for a record being changed or deleted.

*IMMED

The program does not wait. Immediate allocation of file resources is required.

*NOMAX

The wait time is the maximum allowed by the system, which is 32767 seconds.

integer

Specify the number of seconds that the program waits for a record being changed or deleted. Valid values range from 1 through 32767 seconds.

Top

 

Share open data path (SHARE)

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.

This parameter cannot be specified when *NONE is specified for the Member (MBR) parameter.

*NO

The ODP is not shared with other programs in the routing step. A new ODP for the file is created and used every time a program opens the file.

*YES

The same ODP is shared with each program in the job that also specifies *YES when it opens the file.

Top

 

Max % deleted records allowed (DLTPCT)

Specifies the maximum percentage of deleted records for each member in the source 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 job log.

*NONE

The percentage of deleted records in the file members is not checked.

1-100

Specify the largest allowed percentage of deleted records for any member in the file.

Top

 

Coded character set ID (CCSID)

Specifies the coded character set identifier (CCSID) used to describe character data in the fields of the source file.

*JOB

The current job's default CCSID is used.

*HEX

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

integer

Specify the CCSID to be used.

Top

 

Allow update operation (ALWUPD)

Specifies whether records in this source physical file can be updated.

*YES

Records in this source file can be updated.

*NO

Records in this source file cannot be updated.

Top

 

Allow delete operation (ALWDLT)

Specifies whether records in this source physical file can be deleted.

*YES

Records in this source file can be deleted.

*NO

Records in this source file cannot be deleted.

Top

 

Authority (AUT)

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.

*LIBCRTAUT

The system determines the authority for the object by using the value specified for the Create authority (CRTAUT) parameter on the Create Library command (CRTLIB) for the library containing the object to be created. If the value specified for the CRTAUT parameter is changed, the new value will not affect any existing objects.

*CHANGE

The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.

*ALL

The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) 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 object.

*USE

The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.

*EXCLUDE

The user cannot access the object.

name

Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.

Top


 

Examples

Example 1: Creating a File Without Members

 CRTSRCPF   FILE(SRCLIB/PAYTXS)

This command creates a source file named PAYTXS in the SRCLIB library. The file is created without any members; therefore, no data can be put into the file until a member is added later. As many as 32,767 members (*NOMAX) can be added to the file.

Each member can have up to 10000 records before automatic extensions (499 increments maximum) occur that add 1000 records to the capacity of the member. Only minimum initial storage is allocated for each member with no restrictions on whether the space is connected. The public has object operational, read, add, delete, and update authority for the file, but no object management or object existence authority.

Example 2: Creating a File With a Member

 CRTSRCPF   FILE(ORDERCTL/ORDERS)  MBR(*FILE)  SIZE(100 50 5)

This command creates a source physical file named ORDERS in the ORDERCTL library. Storage space for the records placed in the file need not be contiguous. The initial allocation of storage provides for up to 100 records, and up to five increments of additional space for 50 records each can be added automatically. These allocation values also apply to members of this source file that will be added later.

Example 3: Creating a File that Contains DBCS Data

 CRTSRCPF   FILE(IGCLIB/IGCSRC)  IGCDTA(*YES)

This command creates a source physical file named IGCSRC, which is stored in the library IGCLIB, and can contain DBCS data.

Top


 

Error messages

*ESCAPE Messages

CPF323C

QRECOVERY library could not be allocated.

CPF5702

File either not DDM file or not found.

CPF7302

File &1 not created in library &2.

Top