Command reference / db

CRTLF

Create Logical File

Creates a logical file from the options on this command and from the DDS in a source file. A logical file holds no data records; it describes how records in one or more physical files are presented to a program. A logical file has one or more members, and each member has its own access path to the data in physical file members.

Allowed environments: *ALL. Positional parameters: 4.

Restrictions

Parameters

FILE File

Specifies the logical file to be created. This is a required parameter. The name must follow the naming rules of any high-level language program that uses it, or the program must rename it.

Type
*QUAL
Required
Yes
Case
Uppercase
*CURLIB
The job's current library is used; if none is set, QGPL is used.
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

SRCFILE Source file

Specifies the source file that contains the DDS used to create the logical file.

Type
*QUAL
Required
No
Case
Uppercase
*LIBL
All libraries in the thread's library list are searched until the first match.
*CURLIB
The job's current library is used; if none is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Source file Source file

Type
*NAME
Required
No
Default
QDDSSRC
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *LIBL, *CURLIB

SRCMBR Source member

Specifies the name of the member in the source file that contains the DDS for the logical file.

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

Suggested / special values: *FILE

*FILE
The member name is the same as the FILE parameter name.

GENLVL Generation severity level

Specifies the DDS message severity level at or above which file creation fails. The default is 20. The value must be greater than or equal to FLAG.

Type
*UINT2
Required
No
Default
20
Range
0 to 30
Case
Uppercase

FLAG Flagging severity level

Specifies the minimum severity of messages to be listed. The default is 0, which lists all messages. The value must be less than or equal to GENLVL.

Type
*UINT2
Required
No
Default
0
Range
0 to 30
Case
Uppercase

FILETYPE File type

Specifies whether each member contains data records or source records.

Type
*CHAR
Required
No
Default
*DATA
Length
5
Case
Uppercase

Allowed values: *DATA, *SRC

*DATA
The logical file contains data records.
*SRC
The logical file contains source records. Not valid for join logical files.

MBR Member, if desired

Specifies the logical file member to add when the file is created.

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

Suggested / special values: *FILE, *NONE

*FILE
The member name is the same as the FILE parameter name.
*NONE
No member is added when the file is created.

DTAMBRS Physical file data members

Specifies the physical files and members that hold the data for the logical file member being added. The member can be based on all of them (*ALL) or on a subset.

Type
*ELEM
Required
No
Case
Uppercase
*ALL
Based on all physical files and members that the logical file uses; at least one member must exist in at least one of them.
*CURRENT
The current library for the job is searched; if none is set, QGPL is used.
*NONE
No member name is specified.
Elements in order

Physical file Physical file

Type
*QUAL
Required
No
Case
Uppercase
Qualified parts (object, then library; write LIBRARY/OBJECT)

Physical file Physical file

Type
*NAME
Required
No
Default
QDDSSRC
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *CURRENT

Members Members

Type
*NAME
Required
No
Default
*NONE
Length
10
List limit
32
Case
Uppercase

Suggested / special values: *NONE

TEXT Text 'description'

Specifies the text that briefly describes the object. No more than 50 characters.

Type
*CHAR
Required
No
Default
*SRCMBRTXT
Length
50
Case
Uppercase

Suggested / special values: *SRCMBRTXT, *BLANK

*SRCMBRTXT
Text comes from the source file member if the source is a database file; blank if the source is an inline or device file.
*BLANK
No text is specified.

OPTION Source listing options

Specifies the type of output produced when the file is created. Up to four values may be given in any order.

Type
*CHAR
Required
No
Length
9
List limit
4
Case
Uppercase

Allowed values: *SRC, *NOSRC, *SOURCE, *NOSOURCE, *LIST, *NOLIST, *SECLVL, *NOSECLVL, *EVENTF, *NOEVENTF

*SRC
Prints the source statements and a list of errors (same as *SOURCE).
*NOSRC
Prints source only if errors are detected (same as *NOSOURCE).
*LIST
Creates an expanded source printout showing file specifications and references.
*NOLIST
No expanded source printout is created.
*SECLVL
The DDS printout includes online help text for messages.
*NOSECLVL
The DDS printout does not include message help text.
*EVENTF
Produces an event file for the CODE product.
*NOEVENTF
Produces no event file.

SYSTEM System

Specifies whether the logical file is created on the local system or on a remote system.

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

Allowed values: *LCL, *RMT, *FILETYPE

*LCL
The logical file is created on the local system.
*RMT
The logical file is created on a remote system; FILE must name a DDM file that identifies the remote system and the logical file.
*FILETYPE
If FILE does not exist, the file is created locally; if it is a DDM file, the file is created on the remote system.

MAXMBRS Maximum members

Specifies the maximum number of members the logical file can contain. The default is 1; valid values are 1 through 32767.

Type
*INT4
Required
No
Default
1
Case
Uppercase

Suggested / special values: *NOMAX

*NOMAX
The system maximum of 32,767 members applies.

ACCPTHSIZ Access path size

Specifies the maximum auxiliary storage that access paths for join logical files or keyed files can occupy.

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

Allowed values: *MAX1TB, *MAX4GB

*MAX1TB
Access paths can occupy up to sixteen terabytes.
*MAX4GB
Access paths can occupy up to four gigabytes.

PAGESIZE Access path logical page size

Specifies the logical page size used when the access path is created. The page size is the amount of the access path moved into the job's storage pool on a page fault.

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

Allowed values: *KEYLEN

*KEYLEN
The page size is determined by the total key length; the minimum is 32K.

MAINT Access path maintenance

Specifies, for keyed files or join logical files, how access path maintenance is done for all members.

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

Allowed values: *IMMED, *DLY, *REBLD

*IMMED
The access path is updated each time a record is added, changed, or deleted. Required for files that need unique keys.
*DLY
Maintenance is delayed until the member is opened. Not valid for unique key values.
*REBLD
The access path is rebuilt on each open and deleted on close. Cannot be used for files that need unique keys.

RECOVER Access path recovery

Specifies when recovery of the access path is performed after a system failure during a change. Valid only for join logical files or files with a keyed access path.

Type
*CHAR
Required
No
Length
7
Case
Uppercase

Allowed values: *NO, *AFTIPL, *IPL

*NO
The access path is rebuilt when the file is opened. The default for files that do not require unique keys.
*AFTIPL
The access path is rebuilt after IPL completes. The default for files that require unique keys.
*IPL
The access path is rebuilt during IPL, before any user program can use the file.

FRCACCPTH Force keyed access path

Specifies whether access path changes are forced to auxiliary storage along with the associated records. *YES minimizes, but does not remove, the chance of access path damage after an abnormal job end.

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

Allowed values: *NO, *YES

*NO
The access path and records are not written to auxiliary storage on each change.
*YES
The access path and records are written to auxiliary storage on each change. Cannot be used with MAINT(*REBLD).

UNIT Preferred storage unit

Specifies the preferred storage media for the file.

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

Suggested / special values: *ANY, *SSD

*ANY
No storage media is preferred.
*SSD
Solid state disk storage is preferred, if available.

FMTSLR Rcd format selector program

Specifies the record format selector program called when the logical file member has more than one record format. Not valid if the file has only one record format.

Type
*QUAL
Required
No
Case
Uppercase
*NONE
There is no selector program for this logical file.
*LIBL
All libraries in the thread's library list are searched until the first match.
*CURLIB
The current library is used; if none is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Rcd format selector program Rcd format selector program

Type
*NAME
Required
No
Default
QDDSSRC
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *LIBL, *CURLIB

FRCRATIO Records to force a write

Specifies the number of inserted or updated records processed before they are forced to auxiliary storage. The value cannot be less than or equal to the smallest force ratio of the based-on files.

Type
*INT4
Required
No
Default
*NONE
Case
Uppercase

Suggested / special values: *NONE

*NONE
No force ratio is specified; the system decides when records are written.

WAITFILE Maximum file wait time

Specifies the seconds the program waits for file resources at open, or device or session resources at an acquire. The default is 30.

Type
*INT4
Required
No
Default
30
Case
Uppercase

Suggested / special values: *IMMED, *CLS

*IMMED
The program does not wait.
*CLS
The job's default wait time is used.

WAITRCD Maximum record wait time

Specifies the seconds the program waits for a record being changed or deleted. The default is 60.

Type
*INT4
Required
No
Default
60
Case
Uppercase

Suggested / special values: *IMMED, *NOMAX

*IMMED
The program does not wait.
*NOMAX
The system maximum of 32767 seconds applies.

SHARE Share open data path

Specifies whether the open data path (ODP) is shared with other programs in the same routing step. Not valid when MBR(*NONE) is specified.

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

Allowed values: *NO, *YES

*NO
The ODP is not shared; a new ODP is created each time the file is opened.
*YES
The same ODP is shared with each program in the job that also specifies *YES when it opens the file.

SRTSEQ Sort sequence

Specifies the sort sequence used for this file. It is used with LANGID to determine which sort sequence table is used.

Type
*QUAL
Required
No
Case
Uppercase
*SRC
The table from the ALTSEQ DDS keyword is used; if ALTSEQ is not used, the *JOB value applies.
*JOB
The sort sequence value of the job creating the logical file is used.
*LANGIDSHR
The table may give the same weight to multiple characters; it is the shared weighted table for the LANGID language.
*LANGIDUNQ
The table must give each character in the code page a unique weight.
*HEX
No table is used; hexadecimal character values determine the sort order.
*LIBL
All libraries in the thread's library list are searched until the first match.
*CURLIB
The current library is searched; if none is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Sort sequence Sort sequence

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

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

Suggested / special values: *LIBL, *CURLIB

LANGID Language ID

Specifies the language identifier used with *LANGIDSHR or *LANGIDUNQ on the SRTSEQ parameter to select a sort sequence table.

Type
*CHAR
Required
No
Default
*JOB
Length
50
Case
Uppercase

Suggested / special values: *JOB

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

LVLCHK Record format level check

Specifies whether the level identifiers of the record formats are checked when a program opens the file.

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

Allowed values: *YES, *NO

*YES
Level identifiers are checked; a mismatch sends an open error message to the program.
*NO
Level identifiers are not checked when the file is opened.

AUT Authority

Specifies the authority given to users who have no specific authority, 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, *ALL, *CHANGE, *EXCLUDE, *USE

*LIBCRTAUT
Uses the CRTAUT value of the library containing the new file, at creation time.
*CHANGE
All operations except those limited to the owner or to object existence and management authorities.
*ALL
All operations except those limited to the owner or AUTLMGT authority, including changing ownership.
*USE
Basic operations such as running a program or reading a file; the user cannot change the object.
*EXCLUDE
The user cannot access the object.

Examples

CRTLF FILE(INVEN/STOCKCTL) SRCFILE(SRCLIB/STKLFSRC) MBR(*NONE)

Creates logical file STOCKCTL in library INVEN from the DDS in source file STKLFSRC in SRCLIB, with no members. Only one member can be added later, since MAXMBRS defaults to 1. The user needs *OBJOPR on the based-on physical files, plus object management authority if the file is keyed.

CRTLF FILE(PAYLIB/PAYCODESEQ) SRCFILE(PAYLIB/PAYTXSRC) DTAMBRS(PAYTRANS FIRSTQTR) AUT(*EXCLUDE) TEXT('Pay taxes in code sequence')

Creates logical file PAYCODESEQ and its member, both in PAYLIB, from the PAYTXSRC source file. The member accesses the FIRSTQTR member of physical file PAYTRANS. The file is private to its owner, who needs *OBJOPR on PAYTRANS (and object management authority if keyed).

IBM command documentation

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