VX/PF2PC transforms Pro*Fortran source code to Fortran using Pro*C - OpenVMS Migration



VX/PF2PC is a utility that converts the Oracle SQL calls in pro*Fortran programs to pro*C procedures stored in SQLPC modules.


VX/ForSQL is a utility that converts the Oracle SQL calls in a pro*Fortran program to pro*C procedures stored in an SQLPC modules. VX/PF2PC also modifies the Fortran code to call the new pro*C procedures, so that in one step, pro*Fortran code is converted to Fortran code calling pro*C procedures.

Since about Oracle 11g, the pro*Fortran pre-processor is no longer available through Oracle. Pro*C is still very much supported by Oracle so sites with pro*Fortran now have a way to move forward with Oracle and have Oracle supported pre-processors.

The pro*C procedures no longer depend on the special Fortran-oriented Oracle procedures SQLFX7, SQLFIN and SQLADR to be present in future Oracle release, it’s all pure pro*C.

VX/PF2PC reads the existing .pfo files and generates a .pc file with the associated .h file and a simplified .F source file along with a .inc file with the procedure heads. At that time, the .pc file is run through the Oracle pro*C pre-processor and the proc-generated .c file is compiled with the Gnu C compile and the resulting .o file is linked with the object file generated by the Fortran compiler using the new .F file.

The .pc file contains all the SQL calls extracted from the .pfo file and creates a procedure for each of these SQL calls in pro*C. It names each procedure so that it is unique in the new .pc files. It also stores the procedure head in C format in the .h files, and it stores the procedure head in Fortran format in the .inc file. At the same time, it creates a .F file that now has the SQL code commented out and in place of the SQL code, it now has the procedures that match the ones in the .pfo code and the .inc file.

 

Filename.pfo -> VX/PF2PC and generates: Filename.h: File containing all new procedure heads. Filename.pc: SQLPC module containing the body of all the SQL calls in the original source code. Filename_inc: Fortran header file for all the new procedures. Filename.F: Fortran source code with SQL statements commented out and using the new procedures.
The .F and .inc can be compiled on Linux to produce the .o file. The .pc and .h will run through the pro*C pre-processor and produce a .c file. The generated .c file can be compiled on Linux using Gnu C to produce a .o file. The two generated .o files are linked to create an executable that will run with Oracle.


Page Is Being Updated

Learn More