Example: Access DDM remote members (iSeries server only)

These examples show how access to a DDM file becomes an indirect reference (by using DDM) to a member of a file on a remote iSeries™ server. These examples are iSeries server-to-iSeries server examples.

CRTDDMF  FILE(DDMLIB/RMTCAR)  RMTFILE(SALES/CAR)
   RMTLOCNAME(CHICAGO)
OVRDBF   FILE(FILE1)  TOFILE(DDMLIB/RMTCAR)  MBR(TEST1)
OVRDBF   FILE(FILE2)  TOFILE(DDMLIB/RMTCAR)

This example shows the creation of the same DDM file as in the previous examples. Then, OVRDBF commands are used to override two local files named FILE1 and FILE2 with the local DDM file RMTCAR. When an application program attempts to open the files, the DDM file DDMLIB/RMTCAR is opened twice instead. (FILE1 and FILE2 are not opened.)

After communications are established with the correct target server, the target server's TDDM opens the remote file SALES/CAR twice (two recursions) and opens two different (in this case) members in that file: member TEST1 and member *FIRST (the first member). This example requires only one DDM conversation and one target job because both open operations use the same DDM file and, therefore, the same location.
CLRPFM   FILE(DDMLIB/RMTCAR)  MBR(FRED)

This command clears, by using the DDM file named DDMLIB/RMTCAR, member FRED of the file SALES/CAR on the target server.

Related reference
OVRDBF (Override with Database File) command