ADDPFM (Add Physical File Member)
Purpose
The Add Physical File Member (ADDPFM) command adds a named member to the specified physical file, which must already exist on the system. A member must be added to the physical file before the file can have data stored in it. The first member of a file can be added by entering an ADDPFM command or by specifying a member name in the MBR parameter of the Create Physical File (CRTPF) command. To add other members to the file, use the ADDPFM command to specify each one.
The number of members that can be added to the physical file is limited to the number specified in the MAXMBRS parameter of the associated CRTPF command. Each member added has the same attributes as those defined in the physical file, its own set of data records, and its own access path, as specified in the data description specifications (DDS). The access path determines the order in which the records in that member are processed.
Note: An *EXCLRD lock is required on the file to add a member. Because this command adds a member to a file in a library, the library must not be locked (*SHRNUP or *EXCLRD in the Allocate Object command) for another job. Restrictions
- In multithreaded jobs, this command is not threadsafe for distributed files and fails for distributed files that use relational databases of type *SNA. This command is also not threadsafe and fails for Distributed Data Management (DDM) files of type *SNA, when SYSTEM(*RMT) or SYSTEM(*FILETPYE) is specified.
Required Parameters
- FILE
- Specifies the qualified name of the physical file to which this member is added.
The name of the physical file can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list are searched until the first match is found.
*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library to be searched.
physical-file-name: Specify the name of the file to which the member is added.
If a DDM file is specified, the request is valid only to a target System/38 or iSeries 400.
- MBR
- Specifies the name of the physical file member being added. The member name must be unique in the file to which it is added.
If a DDM file is specified on the FILE parameter, and a member name is specified as part of the remote file name of the DDM file, the MBR name specified must match the member name in the remote file name in the DDM file.
Optional Parameters
- SRCTYPE
- Specifies the source type of a member if this is a source file. The source type option is a character string of no more than 10 characters representing a name. The first character must be alphabetic (including the characters $, @, or #), and the remaining characters must be alphanumeric or an underscore character.
Notes
- The user of this command must ensure the validity of the source type option.
- The source type option can only be used with the Add Physical File Member (ADDPFM) command to add the source type attribute for a source file member.
*NONE: No source type is specified.
source-type: Specify the source type of a member.
- EXPDATE
- Specifies the expiration date. The files cannot be overwritten until the expiration date. The expiration date must be later than or equal to the current date.
Note: An attempt to open a file member that has exceeded its expiration date causes an error message to be sent. (The RMVM command is used to remove the member from the file.) *NONE: No expiration date is specified.
expiration-date: Specify the date after which the member cannot be used. The expiration date must be specified in the format defined by the job attributes, DATFMT and DATSEP. The date must be enclosed in apostrophes if special characters are used in the format.
- SHARE
- Specifies whether the open data path (ODP) for the physical file member is shared with other programs in the routing step. When an ODP is shared, the programs accessing the file share facilities such as the file status and the buffer.
More information on shared database files is in the Database Programming topic in the Information Center.
*NO: The ODP created by the program with this attribute is not shared with other programs in the routing step. Every time a program opens the file with this attribute, a new ODP to the file is created and activated.
*YES: The ODP created with this attribute is shared with each program in the routing step that also specifies SHARE(*YES) when it opens the file.
Note: When SHARE(*YES) is specified and control is passed to a program, a read operation in that program retrieves the next input record. A write operation produces the next output record.
- TEXT
- Specifies the text that briefly describes the physical file member. More information is in Commonly used parameters.
*BLANK: Text is not specified.
'description': Specify no more than 50 characters of text, enclosed in apostrophes.
Example for ADDPFM
ADDPFM FILE(INVENTX) MBR(MONDAYTX) TEXT('Monday''s Inventory Transactions')This command adds a member named MONDAYTX to the physical file named INVENTX. The library list (*LIBL) is used to find the file because the FILE value is not qualified by a library name. The size of the member and the storage allocation values assigned to this member were specified in the CRTPF command that created the physical file. The text, Monday's Inventory Transactions, describes this member of the INVENTX file.
Error messages for ADDPFM
*ESCAPE Messages
- CPF3204
- Cannot find object needed for file &1 in &2.
- CPF7306
- Member &1 not added to file &2 in &3.