Technical Capabilities
Having trouble finding what you need?
Get in touch with us, so we can answer your specific questions directly.
Get In Touch

VX/PF2PC-FORTRAN - FORTRAN with embedded SQL to Pro*C

Description:

VX/PF2PC is a powerful tool that converts Pro*Fortran source code into standard Fortran by replacing Oracle SQL calls with Pro*C procedures stored in SQLPC modules. This ensures compatibility with modern Oracle database environments, as Oracle has discontinued support for the Pro*Fortran pre-processor since Oracle 11g. By transforming ProFortran SQL calls into ProC, VX/PF2PC allows organizations to maintain Oracle-supported database interactions without rewriting entire Fortran applications.

Why Convert ProFortran to ProC?

Ensuring Long-Term Oracle Support

Oracle discontinued Pro*Fortran in Oracle 11g, leaving many legacy applications without a supported pre-processor for SQL queries embedded in Fortran code. VX/PF2PC solves this problem by converting all Pro*Fortran SQL calls into Pro*C procedures, ensuring that applications remain fully compatible with Oracle’s modern database tools.

Pro*C is still fully supported by Oracle, making it the ideal replacement for Pro*Fortran.

• The converted Pro*C procedures no longer rely on Fortran-specific Oracle functions such as SQLFX7, SQLFIN, and SQLADR, making them future-proof for upcoming Oracle releases.

Maintaining Fortran Code Integrity

Instead of requiring a complete rewrite of legacy Fortran applications, VX/PF2PC seamlessly integrates with existing codebases:

Pro*C procedures replace embedded SQL in Fortran, but the structure and logic of the original Fortran program remain intact.

Minimal manual modifications required, allowing a smooth transition while ensuring the codebase remains maintainable.

How VX/PF2PC Works

Step-by-Step Process

VX/PF2PC reads the existing Pro*Fortran source files (.pfo) and generates a set of files required for the migration:

1. Extracts all SQL calls from the .pfo file and converts them into Pro*C procedures, storing them in a .pc SQLPC module.

2. Generates a corresponding .h header file containing the C-style procedure declarations for use in compilation.

3. Creates a .inc Fortran header file storing Fortran-formatted procedure definitions.

4. Produces a new .F Fortran source file, where all SQL statements are commented out and replaced with calls to the newly generated Pro*C procedures.

Compilation and Linking Process

Once the new source files are generated, the build process follows these steps:

1. The .F (Fortran source) and .inc (Fortran header) files are compiled with the Fortran compiler, generating an object file (.o).

2. The .pc (ProC SQL module) and .h (C header) files are processed using the **Oracle ProC pre-processor**, producing a C source file (.c).

3. The C file is compiled using GNU C, generating a second object file (.o).

4. Both object files (.o) are linked together to create a final executable, which interacts seamlessly with Oracle databases.

File Generation Overview
Input File VX/PF2PC Output Files Description
Filename.pfo Filename.h Contains all new Pro*C procedure declarations in C format.
Filename.pc SQLPC module containing the body of all SQL calls extracted from the original source code.
Filename.inc Fortran header file with all the new Pro*C procedure definitions.
Filename.F Fortran source code with SQL statements replaced by calls to the new Pro*C procedures.

Once compiled and linked, the resulting executable will run seamlessly with Oracle, eliminating dependency on Pro*Fortran while maintaining compatibility with existing applications.

Example: Converting ProFortran to ProC

Original Pro*Fortran Code (Before Conversion)
PROGRAM Example
  INCLUDE 'sqlca.inc'
  EXEC SQL BEGIN DECLARE SECTION;
  CHARACTER*20 user;
  CHARACTER*20 password;
  CHARACTER*30 dbname;
  EXEC SQL END DECLARE SECTION;

  EXEC SQL CONNECT :user IDENTIFIED BY :password USING :dbname;

  PRINT *, "Connected to Oracle database"
END PROGRAM
Converted Fortran Code (After VX/PF2PC Processing)
PROGRAM Example
  INCLUDE 'sqlca.inc'
  INCLUDE 'filename.inc'

  CALL connect_to_oracle(user, password, dbname)

  PRINT *, "Connected to Oracle database"
END PROGRAM
Generated Pro*C Code in Filename.pc
#include "sqlca.h"
void connect_to_oracle
(char *user, char *password, char *dbname) {
  EXEC SQL CONNECT :user IDENTIFIED BY :password USING :dbname;
}

The ProFortran SQL calls have been **replaced with calls to a generated ProC procedure**, ensuring that the program continues to work without Pro*Fortran dependencies.

Key Benefits of VX/PF2PC

1. Seamless Migration Without a Full Rewrite

• Existing Fortran applications remain intact, with SQL calls redirected to Pro*C procedures.

• The original program structure remains unchanged, reducing migration complexity.

2. Future-Proofing Against Oracle Updates

• Since Pro*C is fully supported, organizations no longer rely on deprecated Pro*Fortran pre-processors.

• The removal of SQLFX7, SQLFIN, and SQLADR dependencies ensures that applications are compatible with future Oracle versions.

3. Efficient Compilation and Execution

• The newly generated files are structured for efficient compilation and linking, allowing seamless integration into existing build workflows.

• The compiled executable maintains full Oracle database interaction while running natively on Linux.

Conclusion

VX/PF2PC provides an efficient and reliable solution for migrating Pro*Fortran applications to modern Fortran with Pro*C. By automating the conversion of embedded SQL into standalone Pro*C procedures, VX/PF2PC ensures that legacy Fortran applications continue to run seamlessly with Oracle databases, without reliance on deprecated pre-processors.

For organizations looking to modernize their Pro*Fortran applications while maintaining Oracle compatibility, VX/PF2PC delivers a streamlined, future-proof solution that preserves application integrity while enabling seamless migration.

Frequently Asked Questions

Curious about how Sector7 can facilitate your application migration? Explore our FAQs for expert insights.

What is VX/ESQL-FORTRAN and how does it help with Oracle migration?

VX/ESQL-FORTRAN (VX/PF2PC) is a powerful conversion tool that transforms Pro*Fortran source code into standard Fortran by replacing Oracle SQL calls with Pro*C procedures. This is essential because Oracle discontinued Pro*Fortran support since Oracle 11g, leaving legacy applications without supported database interaction methods.

The tool ensures your Fortran applications remain Oracle-compatible while eliminating dependency on deprecated pre-processors. For organizations needing to modernize their Pro*Fortran systems, contact us to discuss your specific requirements.

Why did Oracle discontinue Pro*Fortran support?

Oracle discontinued Pro*Fortran in Oracle 11g as part of their strategy to focus on more widely-used programming languages and modern database interaction methods.

What files does VX/PF2PC generate during conversion?

VX/PF2PC generates four essential files from your original .pfo file: a .h header file with C procedure declarations, a .pc SQLPC module containing converted SQL calls, a .inc Fortran header file, and a .F Fortran source file with SQL statements replaced by Pro*C procedure calls.

How does the compilation process work after conversion?

The compilation follows a two-stage process: first, the .F and .inc files compile with the Fortran compiler to create an object file, then the .pc and .h files process through Oracle's Pro*C pre-processor and compile with GNU C to create a second object file. Both objects link together for the final executable.

Does VX/ESQL-FORTRAN require rewriting existing Fortran applications?

No, VX/ESQL-FORTRAN preserves your existing Fortran code structure and logic. The tool seamlessly integrates with current codebases by replacing embedded SQL with Pro*C procedure calls while maintaining program integrity. Organizations like Allianz have successfully used similar approaches for their legacy system migrations.

What Oracle dependencies are removed during conversion?

The conversion removes dependencies on deprecated Fortran-specific Oracle functions including SQLFX7, SQLFIN, and SQLADR, making your applications future-proof for upcoming Oracle releases.

How does VX/PF2PC handle SQL statement conversion?

VX/PF2PC extracts all SQL calls from your Pro*Fortran source and converts them into Pro*C procedures stored in SQLPC modules. The original SQL statements are commented out in the Fortran source and replaced with calls to these newly generated procedures, ensuring clean separation between business logic and database interaction.

What are the key benefits of using VX/ESQL-FORTRAN?

VX/ESQL-FORTRAN delivers seamless migration without full application rewrites, future-proofing against Oracle updates, and efficient compilation processes. The tool maintains full Oracle database interaction while running natively on Linux, eliminating vendor lock-in and reducing infrastructure costs.

Companies like BNY Mellon have leveraged similar modernization strategies to enhance their financial systems. To explore how VX/ESQL-FORTRAN can benefit your organization, contact our migration specialists.

Transform Your Legacy Software Today!

Get In Touch
Unlock the potential of your legacy software with our expert migration services.