APPX Software Library

Data Dictionary, Files and Event Points

Copying Files between Databases/Versions

The following example shows how all of the records in the CUSTOMER file in database AAA can be copied to the CUSTOMER file in database BBB:

*
*        Open file in source database
*
SET      --- NEXT DATABASE              =      AAA
OPEN     SPF CUSTOMER  SHARE? Y  FAIL 0 CACHE? N
*
BEG READ SPF CUSTOMER               HOLD 0 KEY IS  CUSTOMER NO
*
*        Open file in destination database
*
SET      --- NEXT DATABASE              =      BBB
OPEN     SPF CUSTOMER  SHARE? Y  FAIL 0 CACHE? N
WRITE    SPF CUSTOMER               FAIL 0
*
*        Open file in source database
*
SET      --- NEXT DATABASE              =      AAA
OPEN     SPF CUSTOMER  SHARE? Y  FAIL 0 CACHE? N
*
END READ SPF CUSTOMER

When you use the above technique to switch between a file that has been created in two different databases, the two databases MUST be associated with the same application version. In the System Administration file for Databases / Applications, database AAA and database BBB must both identify a startup application with the same Version.

For example, if the Startup Application for database AAA is XXX 01, then the startup application for database BBB must also have a version of "01". The application ID can be different but the version must be the same.