Auxiliary Input to the
RLX
/Precompiler

Describes how to use the RCSAUX file to provide more input to the
RLX
/Precompiler.
The optional RCSAUX file may be used to provide auxiliary input to the
RLX
/Precompiler. Typically this includes statements that assign values to REXX variables that appear in
RLX
statement strings so the statements can be resolved as static SQL requests at compile time. For example, you can provide an Authid and/or Db2 table name as auxiliary input as illustrated in the following example:
"RLX SELECT NAME, OWNER FROM" Db2_table_name
The previous statement is not compilable or executable by itself since the Db2 table name is undefined. However, you can provide auxiliary input to the
RLX
/Precompiler through the RCSAUX file as follows:
//RCSAUX DD * Db2_table_name = 'SYSIBM.SYSDATABASE' /*
The REXX statement that is supplied in the RCSAUX input stream assigns the value SYSIBM.SYSDATABASE to the REXX variable named Db2_table_name. The Precompiler writes this assignment statement to the RCSEXTR output file, ahead of the extracted
RLX
SELECT statement. At compile time, the value of Db2_table_name is properly resolved so that
RLX
/Compile can successfully produce static SQL for the statement.
The static SQL load module and application plan that is thus produced may only reference the table that is named SYSIBM.SYSDATABASE. If the name Db2 table is to be resolved at run-time, only dynamic SQL can be used.
To run as a static SQL application, you must create a unique Db2 plan, SQL load module, and compiled REXX load module for each discrete value that Db2_table_name assume at run time. For example, to use the EXAMPLE exec described earlier to access a shadow Db2 catalog table named DBA.SYSDATABASE using static SQL, you have recompiled the EXEC to produce a separate Db2 application plan and SQL load module, this time specifying the following auxiliary input through the RCSAUX file:
//RCSAUX DD * Db2_table_name = 'SYSIBM.SYSDATABASE' /*