Command reference / db
CHGPF
Change Physical File
Changes the attributes of a physical file and all its members. The changed attributes are used for all members subsequently added to the file unless other values are specified or defaulted for the add operation. To change the attributes of a specific member, use CHGPFM. If format attributes change, the existing data is converted based on field names, and data in a field whose name changed is lost. Changes to data or access path attributes can take a long time, and status messages are sent to the interactive user during the operation.
Allowed environments: *ALL.
Positional parameters: 1.
Restrictions
- You must have object management (*OBJMGT) or object alter (*OBJALTER) authority for the file and execute (*EXECUTE) authority to the library. An exclusive-no-read lock is required, so no one can be using the file.
- If a request is made to reuse deleted records but logical files over the physical file specify FIFO or LIFO ordering for duplicate keys, the change is not allowed.
Parameters
FILE
Physical file
Specifies the physical file to be changed. If a DDM file is specified, it identifies the name of the physical file and the remote system to change. This is a required parameter.
*LIBL- All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB- The current library for the thread is used to locate the file; if none is specified for the job, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Physical file
Physical file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SYSTEM
System
Specifies whether the physical file is changed on the local system or on a remote system using distributed data management (DDM).
Allowed values:
*LCL, *RMT, *FILETYPE
*LCL- The physical file is changed on the local system.
*RMT- The physical file is changed on a remote system using DDM; FILE must name the DDM file.
*FILETYPE- If FILE names a DDM file, the file is changed on the remote system named in it; otherwise the local file is changed.
SRCFILE
Source file
Specifies the source file containing the DDS that describes the record format, fields and access path used to change the physical file.
Suggested / special values:
*NONE
*NONE- No source file is specified; neither format nor access path attributes are changed.
*LIBL- All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB- The current library for the thread is searched; if none is specified, QGPL is searched.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Source file
Source file
Library
Library
Suggested / special values:
*LIBL, *CURLIB
SRCMBR
Source member
Specifies the source file member that contains the DDS for the physical file. Valid only when a source file is specified.
Suggested / special values:
*FILE
*FILE- The source member name is the same as the name of the physical file being changed.
OPTION
Source listing options
Allowed values:
*SRC, *NOSRC, *SOURCE, *NOSOURCE, *LIST, *NOLIST, *SECLVL, *NOSECLVL, *EVENTF, *NOEVENTF
GENLVL
Generation severity level
FLAG
Flagging severity level
DLTDEPLF
Delete dependent logical file
Specifies whether logical files and SQL materialized query tables dependent on a field that the change removes from the file are deleted.
Allowed values:
*NO, *YES
*NO- The dependent files are not deleted; the field is not removed and the file is not changed, and the command ends.
*YES- The files dependent on a removed field are deleted.
RMVCST
Remove constraint
Specifies whether constraint relationships in the dependent files are removed when deleting a parent file of a referential constraint. Valid only when DLTDEPLF(*YES).
Allowed values:
*RESTRICT, *REMOVE
*RESTRICT- The constraint relationships are not removed; the parent file is not removed and the file is not changed, and the command ends.
*REMOVE- Constraints dependent on a removed field are removed; removing a unique constraint also removes dependent referential constraints.
EXPDATE
Expiration date for member
Specifies the expiration date for all members of the file; members should not be used after this date. Must be in job date format and not earlier than the current date.
Suggested / special values:
*SAME, *NONE
*SAME- The expiration date of the file does not change.
*NONE- No expiration date is specified.
MAXMBRS
Maximum members
Specifies the maximum number of members the physical file can have (1 through 32767). It must be greater than or equal to the current number of members.
Suggested / special values:
*SAME, *NOMAX
*SAME- The maximum number of members does not change.
*NOMAX- No maximum is specified; the system maximum of 32,767 members is used.
ACCPTHSIZ
Access path size
Allowed values:
*SAME, *MAX4GB, *MAX1TB
MAINT
Access path maintenance
Allowed values:
*SAME, *IMMED, *REBLD, *DLY
RECOVER
Access path recovery
Allowed values:
*SAME, *NO, *AFTIPL, *IPL
FRCACCPTH
Force keyed access path
Allowed values:
*SAME, *NO, *YES
SIZE
Member size
Specifies the initial number of records in each member, the number of records for each increment, and the maximum number of increments. A zero increment prevents automatic extensions.
*SAME- The value does not change.
*NOMAX- The number of records that can be added to each member is not limited by the user; the system determines the maximum.
Elements in order
Initial number of records
Initial number of records
Suggested / special values:
*SAME
Increment number of records
Increment number of records
Suggested / special values:
*SAME
Maximum increments
Maximum increments
Suggested / special values:
*SAME
ALLOCATE
Allocate storage
Specifies whether initial storage space is allocated for each member when it is added, cleared or reorganized. The change takes effect the next time a member is added, or a member is cleared or reorganized.
Allowed values:
*SAME, *NO, *YES
*SAME- The allocation method does not change.
*NO- The system determines and allocates the space needed when a member is added, cleared or reorganized.
*YES- The initial member size amount is allocated each time; if not available the member is not added. *NOMAX cannot be used for SIZE with this value.
UNIT
Preferred storage unit
Suggested / special values:
*SAME, *ANY, *SSD
FRCRATIO
Records to force a write
Suggested / special values:
*SAME, *NONE
WAITFILE
Maximum file wait time
Suggested / special values:
*SAME, *IMMED, *CLS
WAITRCD
Maximum record wait time
Suggested / special values:
*SAME, *IMMED, *NOMAX
SHARE
Share open data path
Specifies whether the open data path (ODP) is shared with other programs in the same routing step.
Allowed values:
*SAME, *NO, *YES
*SAME- The ODP sharing value does not change.
*NO- The ODP is not shared; a new ODP is created each 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.
DLTPCT
Max % deleted records allowed
Suggested / special values:
*SAME, *NONE
REUSEDLT
Reuse deleted records
Allowed values:
*SAME, *YES, *NO
SRTSEQ
Sort sequence
Qualified parts (object, then library; write LIBRARY/OBJECT)
Sort sequence
Sort sequence
Library
Library
Suggested / special values:
*LIBL, *CURLIB
LANGID
Language ID
Suggested / special values:
*SAME, *JOB
LVLCHK
Record format level check
Allowed values:
*SAME, *YES, *NO
KEEPINMEM
Keep in memory
Allowed values:
*SAME, *NO, *YES
NODGRP
Node group
Qualified parts (object, then library; write LIBRARY/OBJECT)
Node group
Node group
Library
Library
Suggested / special values:
*LIBL, *CURLIB
PTNKEY
Partitioning Key
Suggested / special values:
*SAME
TEXT
Text 'description'
Specifies the text that briefly describes the file, up to 50 characters enclosed in apostrophes.
Suggested / special values:
*SAME, *BLANK
*SAME- The text that describes the file does not change.
*BLANK- No text is specified.
CCSID
Coded character set ID
Suggested / special values:
*SAME, *HEX
Examples
CHGPF FILE(QGPL/INV) EXPDATE('10/31/89')
Changes the expiration date for all members in physical file INV to October 31, 1989.
CHGPF FILE(QGPL/T1) SRCFILE(QDDSSRC)
Adds fields, removes fields and changes field attributes based on the DDS in source member T1 of source file QDDSSRC.
Generated from os/cl/catalog/CHGPF.json and os/cl/help/CHGPF.json.