CPFIRST environment variable

Use the CPFIRST environment variable to specify the default compilation order for all HCL OneDB™ ESQL/C source files in your programming environment.

setenvCPFIRST { TRUE | FALSE }
When you compile HCL OneDB ESQL/C programs with CPFIRST not set, the HCL OneDB ESQL/C preprocessor runs first, by default, on the program source file and then passes the resulting file to the C language preprocessor and compiler. You can, however, compile the HCL OneDB ESQL/C program source file in the following order:
  1. Run the C preprocessor
  2. Run the HCL OneDB ESQL/C preprocessor
  3. Run the C compiler and linker

To use a nondefault compilation order for a specific program, you can either give the program source file a .ecp extension, run the -cp option with the esql command on a program source file with a .ec extension, or set CPFIRST.

Set CPFIRST to TRUE (uppercase only) to run the C preprocessor before the HCL OneDB ESQL/C preprocessor on all HCL OneDB ESQL/C source files in your environment, irrespective of whether the -cp option is passed to the esql command or the source files have the .ec or the .ecp extension.

To restore the default order on a system where the CPFIRST environment variable has been set to TRUE, you can set CPFIRST to FALSE. On UNIX™ systems that support the C shell, the following command has the same effect:
unsetenv CPFIRST