Change DDM File (CHGDDMF)

The Change Distributed Data Management File (CHGDDMF) command changes, in the distributed data management file (DDM) description, one or more of the attributes of the specified DDM file. The DDM file is used as a reference file by programs on the IBM i to access files located on any target system in the IBM i DDM network.

Parameters

Keyword Description Choices Notes
FILE DDM file Qualified object name Required, Key, Positional 1
Qualifier 1: DDM file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
RMTFILE Remote file Single values: *SAME
Other values: Element list
Optional, Positional 2
Element 1: File Single values: *NONSTD
Other values: Qualified object name
Qualifier 1: File Name
Qualifier 2: Library Name, *LIBL, *CURLIB
Element 2: Nonstandard file 'name' Character value
RMTLOCNAME Remote location Single values: *RDB
Other values: Element list
Optional, Positional 3
Element 1: Name or address Character value, *SAME, *DEVD
Element 2: Type *SAME, *SNA, *IP
LVLCHK Record format level check *SAME, *RMTFILE, *NO Optional
RDB Relational database Name, *SAME Optional
TEXT Text 'description' Character value, *SAME, *BLANK Optional
DEV Device Element list Optional
Element 1: APPC device description Name, *SAME, *LOC
LCLLOCNAME Local location Communications name, *SAME, *LOC, *NETATR Optional
MODE Mode Communications name, *SAME, *NETATR Optional
RMTNETID Remote network identifier Communications name, *SAME, *LOC, *NETATR, *NONE Optional
PORT Port number 1-65535, *SAME, *DRDA Optional
ACCMTH Access method Single values: *SAME, *RMTFILE, *COMBINED
Other values: Element list
Optional
Element 1: Remote file attribute *KEYED, *ARRIVAL
Element 2: Local access method *BOTH, *RANDOM, *SEQUENTIAL
SHARE Share open data path *SAME, *NO, *YES Optional
PTCCNV Protected conversation *SAME, *NO, *YES Optional

DDM file (FILE)

Specifies the distributed data management (DDM) file to be changed.

This is a required parameter.

Qualifier 1: DDM file

name
Specify the name of the DDM file.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current job library is used to locate the DDM file. If no library is specified as the current library for the job, QGPL is used.
name
Specify the library where the DDM file is located.

Remote file (RMTFILE)

Specifies the name of the remote file as it is coded on the target system. The remote file does not need to exist when the Distributed Data Management (DDM) file is changed.

Note: This file name must be specified in code page 500.

Single values

*SAME
The name of the remote file does not change.

Element 1: File

Single values

*NONSTD
The remote file name is not at standard IBM i file name. Specify the complete file name in apostrophes for the second element of this parameter.

Qualifier 1: File

name
Specify the name of the remote file as it is known on the remote system. If the remote system is an IBM i, specify the file name. The file name can be up to 10 characters in length. If the remote system is a System/36, the file name is the same as its System/36 file label. The file name can be up to eight characters in length. If the remote system is a System/38, a simple (unqualified) file name can be specified. The file name can be up to 10 characters in length. Labels for all other remote systems (including qualified file names for System/38) must use *NONSTD followed by the remote file name in apostrophes.

Qualifier 2: Library

*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 job is used to locate the file. If no library is specified as the current library for the job, QGPL is used.
name
Specifies the library where the file is located.

Note: The library name is used only if the target system is an IBM i.

Element 2: Nonstandard file 'name'

character-value
For target systems that allow naming conventions other than those used by the IBM i and System/36, and when specifying a qualified System/38 file name and when specifying a member name of a remote IBM i or System/38 file, specify up to 255 characters for the name of the remote file to be accessed. The name must be coded in the form required by the target system. The name must always be enclosed in apostrophes, and may contain lowercase letters, blanks, periods, or any other special characters.

Names for the IBM i, System/38, and System/36 must be in uppercase, and no blanks are allowed.

If the target system is an IBM i or a System/38, a file name, library name, and member name can all be specified. If a member name is specified, the full file name must be enclosed in apostrophes and must follow the value *NONSTD, and the member name must be enclosed in parentheses and immediately follow (with no space) either the library name (System/38) or the file name (IBM i).

Remote location (RMTLOCNAME)

Specifies the remote (target) system location name or address used with the distributed data management (DDM) file. Multiple DDM files can use the same remote location for the target system.

Single values

*RDB
The remote location information from the relational database entry specified for the Relational database (RDB) parameter is used to determine the remote system.

Element 1: Name or address

*SAME
The remote location name specified in the file description does not change.
*DEVD
The remote location name defined in the device description specified for the Device (DEV) parameter is used.

Note: If *LOC is specified for the DEV parameter, a remote location name must be specified for this parameter.

character-value
Specify the name or address of the remote location that is associated with the target system. The remote location, which is used in accessing the target system, does not need to exist when the DDM file is created but must exist when the DDM file is opened. The remote location can take several forms:
  • SNA remote location name (LU name). Specify a maximum of 8 characters for the remote location name. If this form is used, the address type of this parameter must be *SNA (the default).
  • SNA remote network identifier and remote location name separated by a period. Specify a maximum of 8 characters for the remote location name, and a maximum of 8 characters for the remote network identifier. If this form of the parameter is used, the address type of this parameter must be *SNA (the default), and any value specified for the RMTNETID parameter must agree. If the RMTNETID parameter is not specified, the RMTNETID value will be set to agree with the RMTLOCNAME parameter.
  • IP address in dotted decimal form. Specify an internet protocol version 4 address in the form nnn.nnn.nnn.nnn where each nnn is a number in the range 0 through 255. If this form is used, the address type of this parameter must be specified as *IP.
  • IP address in colon hexadecimal form. Specify an internet protocol version 6 address in the form xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx where each xxxx is a hex number in the range 0 through FFFF. If this form is used, the address type of this parameter must be specified as *IP. IP version 6 includes the IPv4-mapped IPv6 address form (for example, ::FFFF:1.2.3.4). For IP version 6, the compressed form of the address is allowed.
  • IP host domain name. Specify an internet host domain name of up to 254 characters in length. If this form is used, the address type of this parameter must be specified as *IP.

If *IP is specified for the address type, the DDM server at the remote location must support the use of TCP/IP, and the DEV, LCLLOCNAME, RMTNETID, and MODE parameters will be ignored.

If *IP is not specified, the DDM server must support SNA connectivity, and the PORT parameter will be ignored.

Element 2: Type

*SAME
The address type does not change.
*SNA
The remote location has a Systems Network Architecture (SNA) address type.
*IP
The remote location has an Internet Protocol (IP) address type.

Record format level check (LVLCHK)

Specifies whether the level identifiers in the program are checked with the level identifiers of the record formats in the remote file when the distributed data management (DDM) file is opened. If they do not match, an error message is sent to the program requesting the open, and neither the DDM file nor the associated remote file is opened. This parameter value can be overridden by an Override Database File (OVRDBF) command before the remote file is opened.

*SAME
The level identifiers value does not change.
*RMTFILE
The level identifiers of the record formats of the remote file are checked at the time the DDM file is opened.

Note: For systems other than IBM i, the program must be compiled (or recompiled) by using the DDM file. During the compile operation, the DDM file is used to establish communications with the target system, get the remote file's attributes from the target system, and create the level identifier values so they can be included in the compiled program for later level checking.

*NO
The level identifiers are not checked when the file is opened.

Relational database (RDB)

Specifies the relational database entry that is used to determine the remote location information for the DDM file.

*SAME
The relational database entry does not change.
name
Specify the name of the relational database entry that identifies the target system or target ASP (auxiliary storage pool) group. The relational database name can refer to a remote system or an ASP group that is configured and available on a remote system. The relational database entry does not need to exist when the DDM file is created but must exist when the DDM file is opened. This parameter is required when *RDB is used as the remote location name (RMTLOCNAME parameter).

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*SAME
The text (if any) does not change.
*BLANK
No text is specified.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.

Device (DEV)

Specifies the name of the advanced program-to-program communications (APPC) device description on the source system that is used with this DDM file.

This parameter will be ignored if *IP is specified for the Remote location (RMTLOCNAME) parameter.

More information on device names is in the APPC Programming book, SC41-5443.

*SAME
The device name specified in the file description does not change.
*LOC
The device associated with the remote location is used. If several devices are associated with the remote location, the system determines which device is used.

Note: If *DEVD is specified for the RMTLOCNAME parameter for the remote location, a device name must be specified for this parameter.

name
Specify the name of a communications device that is associated with the remote location. If the device name is not valid for the remote location, an escape message is sent when the DDM file is opened.

Local location (LCLLOCNAME)

Specifies the local location name.

This parameter will be ignored if *IP is specified for the Remote location (RMTLOCNAME) parameter.

*SAME
The local location name specified in the file description does not change.
*LOC
The local location name associated with the remote location is used.
*NETATR
The LCLLOCNAME value specified in the system network attributes is used.
communications-name
Specify the name of the local location used with the remote location name. The local location name is only specified to indicate a specific local location for the remote location.

Mode (MODE)

Specifies the mode name that is used with the remote location name to communicate with the target system.

This parameter will be ignored if *IP is specified for the Remote location (RMTLOCNAME) parameter.

More information on mode names is in the APPC Programming book, SC41-5443.

*SAME
The mode name does not change.
*NETATR
The mode in the network attributes is used.
BLANK
A mode name consisting of 8 blank characters is used.
communications-name
Specify the name of the mode that is used. If the mode name is not valid for any combination of remote location name and local location name, an escape message is sent when the Distributed Data Management (DDM) file is opened.

Remote network identifier (RMTNETID)

Specifies the remote network identifier (remote network ID) in which the remote location resides, and which is used to communicate with the target system.

If this parameter is specified, the value specified for the Remote location (RMTLOCNAME) parameter must be consistent with the RMTNETID parameter. If the RMTLOCNAME parameter specified a network ID, this parameter must agree (otherwise, an error message will be issued). If the RMTLOCNAME parameter does not specify any network ID, there is no possibility of conflict with this parameter.

This parameter will be ignored if *IP is specified for the RMTLOCNAME parameter.

More information on remote network IDs is in the APPC Programming book, SC41-5443.

*SAME
The remote network ID specified in the file description does not change.
*LOC
The remote network ID associated with the remote location is used.
*NETATR
The remote network identifier specified in the network attributes is used.
*NONE
No remote network ID is used.
communications-name
Specify the remote network ID to be associated with the remote location. The remote network ID is specified only if the user wants to indicate a specific remote network ID for the remote location. If the remote network ID is not valid for the remote location, an escape message is sent when the distributed data management (DDM) file is opened.

Port number (PORT)

Specifies the TCP/IP port that is used at the remote location to communicate with the system on which the remote file is located.

This parameter will be ignored if *SNA is specified for the Remote location (RMTLOCNAME) parameter.

*SAME
The value does not change.
*DRDA
The DRDA well-known port of 446 will be used. This is the port on which the IBM i DDM TCP/IP server listens.
1-65535
Specify a port number.

Access method (ACCMTH)

Specifies the distributed data management (DDM) access method used to open the remote file and access its records when the target system is not an IBM i. Specifying a value other than *RMTFILE for this parameter may improve performance when requests to remote files are processed on the target system. This parameter is ignored when the target system is an IBM i system or a System/38. The remote system file is accessed as if it is a local file.

Single values

*SAME
The access method does not change.
*RMTFILE
The source system selects the access method that is compatible with the attributes of the remote file identified by the Remote file (RMTFILE) parameter and the access methods supported by the target system for that file. For target systems other than IBM i, if this value is used and the source system cannot select an access method when the file is opened, a message is sent to the program user.
*COMBINED
The DDM combined access method is used for the remote file. This access method combines the file processing capabilities of the combined by key (*KEYED *BOTH) and the combined by record number (*ARRIVAL *BOTH) access methods, as shown in the following table. The record can be selected with a key value or a record number. From that position, the position can be set relatively or randomly by key value or by record number. If duplicate keys are present in the file, they are processed in the order defined by each target system's implementation of the DDM architecture.

Element 1: Remote file attribute

*KEYED
Remote file is a keyed file.
*ARRIVAL
Remote file is a non-keyed file.

Element 2: Local access method

*BOTH
Remote file allows both sequential and random record access.
*RANDOM
Remote file allows random record access.
*SEQUENTIAL
Remote file allows sequential record access.

Determining the Access Method

The two elements of this parameter indicate the access method to be used to access the remote file. The following table shows the combinations of values for the ACCMTH parameter. The remote file attributes (in the far left column) refer to the type of file on the target system. The local access method (in the last three columns) refers to the way in which the source IBM i program intends to access the records in the remote file.

Figure: Access Method Combinations of Values
Relative by record number access method (*ARRIVAL *SEQUENTIAL):
This method allows access to records relative to the current position in record number sequence. The record number is not specified to identify the record.
Random by record number access method (*ARRIVAL *RANDOM):
This method allows access to records by specifying a record number in a random sequence determined by the requester.
Combined by record number access method (*ARRIVAL *BOTH):
This method combines the capabilities of the relative by record number and random by record number access methods.
Relative by key access method (*KEYED *SEQUENTIAL):
This method allows records in a keyed file accessed in key value sequence. Records can be accessed by moving forward or backwards in key sequence from the current record. The key value is not specified to identify the record.
Random by key access method (*KEYED *RANDOM):
This method allows records in a keyed file accessed in a random sequence. Records are selected by their key value and not their position in the file.
Combined by key access method (*KEYED *BOTH):
This method combines the capabilities of the relative by key and random by key access methods.

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.

*SAME
The value does not change.
*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.

Protected conversation (PTCCNV)

Specifies whether the DDM conversation that is started for the DDM file is a protected conversation or not. A protected conversation is a conversation that uses two-phase commit protocols to ensure, even if a failure occurs, updates made on the remote system are synchronized with updates to other remote or local resources. A protected conversation is required to use two-phase commitment control with DDM. Two-phase commit is not implemented over TCP/IP for non-RDB DDM files, so protected conversations are not supported when the remote location type is *IP. Two-phase commit is implemented over TCP/IP for RDB DDM files. If a protected conversation is required when the remote location type is *IP, specify PTCCNV(*YES) with a *RDB remote location name for the RMTLOCNAME parameter and a relational database for the RDB parameter. More information on using two-phase commitment control with DDM is in the Distributed database programming topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. PTCCNV(*NO) must be specified if *IP is specified for the Remote location (RMTLOCNAME) parameter.

*SAME
The value does not change.
*NO
The DDM conversation started, using this DDM file, is not a protected conversation.
*YES
The DDM conversation started, using this DDM file, is a protected conversation. Two-phase commitment control can be used with this DDM file.

Examples

The following examples describe the changing of a DDM file.

Example 1: Changing the Communications Mode System

CHGDDMF   FILE(SOURCE/SALES)  MODE(MODEX)

This command changes the communications mode for the DDM file named SALES stored in the SOURCE library on the source system. The mode is changed to MODEX.

Example 2: Changing a DDM File to Access a File through TCP/IP

CHGDDMF   FILE(OTHER/SALES)  RMTLOCNAME(ROCHESTER.XYZ.COM *IP)
          PORT(*DRDA)

This command changes the remote location name for the DDM file named SALES stored in the OTHER library on the source system. The remote location is changed to the TCP/IP host having the domain name of ROCHESTER.XYZ.COM. The host listens on the standard DRDA port of 446.

Example 3: Changing a DDM File to Access a File through TCP/IP using a dotted decimal IP version 4 address and a numeric port number

CHGDDMF   FILE(OTHER/SALES)  RMTLOCNAME('9.5.36.17' *IP)
          PORT(5021)

This command changes the remote location name for the DDM file named SALES stored in the OTHER library on the source system. The remote location is changed to the TCP/IP host with the IP address of 9.5.36.17. The host listens on port 5021.

Example 4: Changing a DDM File to Access a File through TCP/IP using a colon hexadecimal IP version 6 address and a numeric port number

CHGDDMF   FILE(OTHER/SALES)
          RMTLOCNAME('2001:DB8:0:B33D:8785:0:1734:F51C'
          *IP) PORT(32)

This command changes the remote location name for the DDM file named SALES stored in the OTHER library on the source system. The remote location is changed to the TCP/IP host with the IP address of 2001:DB8:0:B33D:8785:0:1734:F51C. The host listens on port 32.

Error messages

*ESCAPE Messages

CPF7304
File &1 in &2 not changed.