Progress/400
Product Guide


Multiple Members in Physical Files

Progress/400 does not support logical files that are built over multiple members in a physical file. Suppose, for example, that the physical file SAMPLE contains the members M1, M2, M3, and M4. You now create the logical file SAMPLEL from SAMPLE and then enter the ADDLFM (Add Logical File Member) command as follows:

ADDLFM FILE(SAMPLEL) MBR(SAMPLEL) DTAMBRS(*CURRENT/SAMPLE(M1 M2 M3 M4)) 

This command adds the member SAMPLEL, built over all of the members included in the DTAMBRS parameter, to the logical file SAMPLEL.

Progress/400 uses relative record numbers for its internal processing and positioning. The DataServer cannot position to a record in a structure such as this because ILE/C does not directly support it. As a work around, simply create matching members in both the logical and physical files. Use the following OS/400 commands to add the logical file members:

ADDLFM FILE(SAMPLEL) MBR(M1) DTAMBRS((*CURRENT/SAMPLE (M1))
ADDLFM FILE(SAMPLEL) MBR(M2) DTAMBRS((*CURRENT/SAMPLE (M2))
ADDLFM FILE(SAMPLEL) MBR(M3) DTAMBRS((*CURRENT/SAMPLE (M3))
ADDLFM FILE(SAMPLEL) MBR(M4) DTAMBRS((*CURRENT/SAMPLE (M4))
DO TRANSACTION:
   CREATE QCMD.
   ASSIGN cmd = "!CLOSE SAMPLE".
   RELEASE QCMD.
   CREATE QCMD.
   ASSIGN cmd = "! OVRDBF FILE(SAMPLEL) TOMBR(M4)".
   RELEASE QCMD.
   CREATE QCMD.
   ASSIGN cmd = "! OVRDBF FILE(SAMPLE) TOMBR(M4)".
   RELEASE QCMD.
END. 

The result is that the logical file SAMPLEL now contains the members M1, M2, M3, and M4.

The following code can successfully retrieve the correct record from member M4:

...
FOR EACH sample USE-INDEX SAMPLEL
... 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095