You can use the following directives to compile code sections conditionally:
EXEC SQL ifdef name END-EXEC.
Checks a name and processes subsequent lines if name has been created with EXEC SQL define name.
EXEC SQL ifndef name END-EXEC.
Checks a name and processes subsequent lines if name has not been created with EXEC SQL define name.
EXEC SQL else END-EXEC.
Starts processing an alternative section to a section introduced by either EXEC SQL ifdef name or EXEC SQL ifndef name.
EXEC SQL elif name END-EXEC.
Checks name and starts an alternative section if name has been created with EXEC SQL define name.
EXEC SQL endif END-EXEC.
Ends an alternative section.
Example:
EXEC SQL ifndef TZVAR END-EXEC. EXEC SQL SET TIMEZONE TO 'GMT' END-EXEC. EXEC SQL elif TZNAME END-EXEC. EXEC SQL SET TIMEZONE TO TZNAME END-EXEC. EXEC SQL else END-EXEC. EXEC SQL SET TIMEZONE TO TZVAR END-EXEC. EXEC SQL endif END-EXEC.