The examples show how access to a DDM file becomes an indirect reference (by using DDM) to the actual file on some other server. These examples are iSeries™-to-iSeries examples.
CRTDDMF FILE(DDMLIB/RMTCAR) RMTFILE(SALES/CAR) RMTLOCNAME(CHICAGO) TEXT('Chicago file SALES/CAR')
This command creates a DDM file named RMTCAR and stores it in the DDMLIB library on the local server. The remote file to be accessed is the CAR database file in the SALES library on the Chicago server. (The remote file is not accessed at the time the Create DDM File (CRTDDMF) command is used to create the DDM file. The existence of the file SALES/CAR is not checked when the DDM file is created.) Later, when the DDM file is accessed by a local program, the remote location CHICAGO is used by DDM to access the SALES/CAR file on the Chicago server.
CPYF FROMFILE(QGPL/AUTO) TOFILE(DDMLIB/RMTCAR)
This command copies the data from the AUTO file in the QGPL library on the local server into a remote file named SALES/CAR on the Chicago server, by using the DDM file DDMLIB/RMTCAR.
ALCOBJ OBJ((DDMLIB/RMTCAR *FILE *EXCL))
ALCOBJ OBJ((SALES/CAR *FILE *EXCL *FIRST))is run on the target server.
OVRDBF FILE(FILEA) TOFILE(DDMLIB/RMTCAR) POSITION(*RRN 3000)
This command overrides the database file FILEA with the DDM file RMTCAR, stored in the DDMLIB library. Both files are on the source server. Whatever remote file is identified in the DDM file (in this case, SALES/CAR on the Chicago system) is the file actually used by the source server program. When the remote file is opened, the first record to be accessed is record 3000.
DSPPFM FILE(DDMLIB/RMTCAR)
This command displays the records in the first member of the remote file SALES/CAR, which is associated with the DDM file DDMLIB/RMTCAR.
DSPOBJD OBJ(DDMLIB/RMTCAR) OBJTYPE(*FILE)
This command displays, on the local server, the object description of the RMTCAR DDM file. No reference is made by this command to the associated remote file on the Chicago server.
DSPFD FILE(DDMLIB/RMTCAR) TYPE(*ATR) FILEATR(*DDM) SYSTEM(*LCL)
This command displays, on the source server, the file description of the DDM file named RMTCAR in the DDMLIB library. As indicated by the TYPE parameter, the attributes of the DDM file are displayed. Only the DDM file's attributes are displayed because FILEATR(*DDM) is specified.
Because SYSTEM(*LCL) is specified, the attributes of the DDM file are displayed and the remote server is not accessed. If SYSTEM(*RMT) is specified, the attributes of the associated remote file are displayed. If *RMT or *ALL is specified, the remote server is accessed to get the attributes of the remote file.
DLTF FILE(DDMLIB/RMTCAR) SYSTEM(*LCL)
This command deletes the DDM file on the local server. Again, no reference is made to the associated SALES/CAR file on the Chicago server. If SYSTEM(*RMT) or SYSTEM(*FILETYPE) is specified, SALES/CAR on the Chicago server would be deleted.