The host-language specific include files for FORTRAN have the file extension .f on UNIX platforms, and .for on OS/2. You can use the following FORTRAN include files in your applications.
Two SQLCA files are provided for FORTRAN applications. The default, sqlca_cs.f, defines the SQLCA structure in an IBM SQL compatible format. The sqlca_cn.f file, precompiled with the SQLCA NONE option, defines the SQLCA structure for better performance.
There are two methods for including files: the EXEC SQL INCLUDE statement and the FORTRAN INCLUDE statement. The precompiler will ignore FORTRAN INCLUDE statements, and only process files included with the EXEC SQL statement.
To locate the INCLUDE file, the DB2 FORTRAN precompiler searches the current directory first, then the directories specified by the DB2INCLUDE environment variable. Consider the following examples:
If the file specified in the INCLUDE statement is not enclosed in quotation marks, as above, the precompiler searches for payroll.sqf, then payroll.f (payroll.for on OS/2) in each directory in which it looks.
If the file name is enclosed in quotation marks, as above, no extension is added to the name. (For OS/2, the file would be specified as 'pay\payroll.for'.)
If the file name in quotation marks does not contain an absolute path, then the contents of DB2INCLUDE are used to search for the file, prepended to whatever path is specified in the INCLUDE file name. For example, with DB2 for AIX, if DB2INCLUDE is set to '/disk2:myfiles/fortran', the precompiler searches for './pay/payroll.f', then '/disk2/pay/payroll.f', and finally './myfiles/cobol/pay/payroll.f'. The path where the file is actually found is displayed in the precompiler messages. On OS/2, substitute back slashes (\) for the forward slashes, and substitute 'for' for the 'f' extension in the above example.
Note: | The setting of DB2INCLUDE is cached by the DB2 Command Line Processor. To change the setting of DB2INCLUDE after any CLP commands have been issued, enter the TERMINATE command, then reconnect to the database and precompile as usual. |