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:
- The record format of the remote file must be described in the program; that is, it must be a program-described file.
- The program must be compiled with the program referring to a local iSeries file instead of the System/36 file. This local file must have the same record format name as the DDM file name. Note that the local file need not contain any data records.
Here is a sample of the pseudocode to accomplish the task:
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
Parent topic:
Examples: Code DDM-related tasks
Related reference
Data description specifications considerations for DDM