DDM example 4: Access a file on System/36

This topic shows how the pseudocode program for the previous task can be changed so a MASTER file on the System/36™ in Dallas can be accessed in the same way as the MASTER files on the iSeries™ servers and System/38™ in Example 3.

Assume that either you have pass-through to the System/36, or that an operator at the System/36 can make changes, if necessary, on the System/36 for you.

The following command is issued on the server in Philadelphia:

CRTDDMF  FILE(PGMLIB/DALFILE)  RMTFILE(MASTER)
   RMTLOCNAME(DAL)  ACCMTH(*KEYED)

Because the remote file referred to by the DDM file named DALFILE is on a System/36, either of two things must be done:

Here is a sample of the pseudocode to accomplish the task:

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
DECLARE CHIFILE, TORFILE, NYCFILE, DALFILE INPUT
Open CHIFILE, TORFILE, NYCFILE and DALFILE
LOOP:  Show a display asking for ITEMNO
Read ITEMNO from the display
   Read record from CHIFILE with the key ITEMNO
   Read record from TORFILE with the key ITEMNO
   Read record from NYCFILE with the key ITEMNO
   Read record from DALFILE with the key ITEMNO
   Write all QOH values to the display
   If not function key, go to LOOP
Close CHIFILE, TORFILE, NYCFILE and DALFILE
END
Related reference
Data description specifications considerations for DDM