DDM example 1: Simple inquiry application

This first example shows how multiple locations in a customer's business might be processing the same inquiry application on their own servers, using their own primary files. Without DDM, the two locations shown here (Chicago and Toronto) have their own primary file (CUSTMAST), both with different and duplicate levels of information.

Figure 1. Two non-DDM servers doing local inquiries
This figure is described in the preceding text.

The following program (in pseudocode form) is run at each location to access its own primary file named CUSTMAST.

       Open CUSTMAST
LOOP:  Prompt for CUSTNO
       If function 1, go to END
       Get customer record
       Display
       Go to LOOP
END:   Close CUSTMAST
       RETURN

Using DDM, the CUSTMAST files are consolidated into one file at a centralized location (Philadelphia, in these examples), and then the local files in Chicago and Toronto can be deleted. The inquiry program used at each remote location and at the central location to access that file is identical to the program used previously.

To perform remote inquiries without changing the program, each of the remote locations need only create a DDM file and use an override command:

CRTDDMF   FILE(INQ)  RMTFILE(CUSTMAST)  RMTLOCNAME(PHILLY)

OVRDBF  FILE(CUSTMAST) TOFILE(INQ)

The DDM file points to the Philadelphia server as the target server and to the CUSTMAST file as the remote file. The same values for this command can be used at each remote location if they also have a remote location named PHILLY.

Because CUSTMAST is the file name used in the program, the Override with Database File (OVRDBF) command must be used to override the nonexistent CUSTMAST file with the DDM file INQ. (If the CUSTMAST file still exists on the local server, the override is needed to access the central server's primary file; without it, the local file is accessed.)

The figure below shows the same two servers accessing the centralized CUSTMAST file by using their DDM files, each named INQ.

An alternative to this approach is to leave the CUSTMAST files on the Chicago and Toronto servers and use them for nonessential inquiries, such as name and address, and use the central CUSTMAST file in Philadelphia for any changes. The CUSTMAST files on the Chicago and Toronto servers can be changed periodically to the current level of the primary file on the Philadelphia server.

This alternative method will be used in the next example.

Figure 2. Two DDM servers doing remote inquiries
This figure is described in the preceding text.
Related concepts
Control language