7.98.2 POINT Comments/Warnings

      POINT FILE(XXXXX) TO_FILE(XXXXX) TO_LIBRARY(*LIBL)

           TO_MEMBER(*FIRST)

     This means that by default files are opened with the same name as they were coded, using the library list to locate the file and accessing the first member in the file.

 

          POINT FILE(CUSTMST) TO_MEMBER(CURRENT)

          FETCH FIELDS(#NAME) FROM_FILE(CUSTMST) WITH_KEY(#CUSTNO)

          POINT FILE(CUSTMST) TO_MEMBER(ARCHIVE)

          FETCH FIELDS(#NAME) FROM_FILE(CUSTMST) WITH_KEY(#CUSTNO)

     The I/O module will abort with an error indicating that member CURRENT is open and you have asked for an I/O to member ARCHIVE.

     The correct way to achieve this is as follows:

          POINT FILE(CUSTMST) TO_MEMBER(CURRENT)

          FETCH FIELDS(#NAME) FROM_FILE(CUSTMST) WITH_KEY(#CUSTNO)

          CLOSE FILE(CUSTMST)

          POINT FILE(CUSTMST) TO_MEMBER(ARCHIVE)

          FETCH FIELDS(#NAME) FROM_FILE(CUSTMST) WITH_KEY(#CUSTNO)

     Consider the following examples of standard coding at the beginning of all RDML programs used in a multi-member financial system:

          POINT FILE(GLMAST) TO_MEMBER(*COMPANY_MBR)

          POINT FILE(SUMAST) TO_MEMBER(*COMPANY_MBR)

          POINT FILE(FTMAST) TO_MEMBER(*COMPANY_MBR)

     The same feature can be used to determine the name of the library that is to be used. For instance a system that utilizes 3 identical data libraries called PRODUCTION, TESTING1 and TESTING2 might use the following coding at the beginning of all RDML programs:

          POINT FILE(GLMAST) TO_LIBRARY(*DATA_LIBRARY)

          POINT FILE(SUMAST) TO_LIBRARY(*DATA_LIBRARY)

          POINT FILE(FTMAST) TO_LIBRARY(*DATA_LIBRARY)

     The program behind the system variable "*DATA_LIBRARY" works out the required library name from the user profile or some other identifier.