FairCom RTG offers more than just a high-performance file system. The FairCom RTG SQL database engine opens a new and efficient method to access your data from many other applications via SQL. By avoiding the overhead imposed by many hybrid SQL implementations, FairCom RTG gives you the most direct access available.
COBOL and Btrieve data files do not explicitly define a record schema, which is mandatory for SQL. If you want to provide SQL access to this data, you will need to define the record schema through an XDD (eXternal Data Definition) file. The XDD is an external XML file that is stored as a special resource within the data file created through the processes described in this chapter.
FYI: If your data file contains more than one record schema (REDEFINES), FairCom RTG provides an ability to define multiple record schemas, each of which will appear to SQL as a virtual table. See the c-treeDB Virtual Tables technical white paper on the FairCom website.
The procedures in this chapter are optional: they are needed only if you want SQL access to your COBOL data. There are two main parts to this process:
1) Create an XDD
First, you will define the record schema of your data with an XDD file. The method you will use depends on the compiler you are using:
2) Store the XDD in the data file
Next, you will store the XDD in the file and link it to the FairCom DB SQL dictionaries using ctutil -sqlize.
Note: In some cases, these procedures will not produce the desired results because your data may be structured in a way that cannot be interpret correctly. In those situations, you will need to add directives to your copybook to handle the data.