Appendix C. Merge in place: Defining source objects in target system 221
"EXECIO 0 DISKR DDLIXIN (FINIS" /* Close the files */
"EXECIO 0 DISKW DDLIXOUT (FINIS"
TAILORTB
In Example C-10, we provide the REXX procedure used to append the OBID
clause to the CREATE TABLE statements generated by DB2 Admin. The source
of this procedure (the TAILORTB.RXX file) is also part of the additional material
that be downloaded from the Internet (see Appendix E, “Additional material” on
page 265).
Example: C-10 REXX procedure to tailor CREATE TABLE statements
/****************************************************************/
/* REXXSQL
REXX routine name: TAILORTB
This routine will read through the untailored DDL file which
contains CREATE TABLE statements.
For the CREATE TABLE statements it will add the OBID we want to
use when defining the table in the target system.
The tailored DDL is then written to the output file.
Parameters to call this procedure:
METADATA_SSID Target DB2 subsystem containing metadata tables
METADATA_OWNER Owner of the metadata tables in target system
Note that this routine needs to run against the metadata
tables located on the target DB2 system. Review the parameters
to ensure this.
****************************************************************/
/* TRACE(R) */
PARSE ARG METADATA_SSID METADATA_OWNER
SAY ' '
SAY 'TAILORTB executing in DB2 subsystem' METADATA_SSID
SAY ' using metadata from table ' METADATA_OWNER'.ZMCOD_TABLES'
SAY ' '
/*******************************************************************/
/* Add DSNREXX to the host command environment table if not there. */
/*******************************************************************/
'SUBCOM DSNREXX'