Valid For
Extract and Replicat
Description
Use the TRIMVARSPACES and NOTRIMVARSPACES parameters to control whether or not trailing spaces in a source VARCHAR column are truncated when applied to a target CHAR or VARCHAR column. TRIMVARSPACES and NOTRIMVARSPACES can be used at the root level of the parameter file as global ON/OFF switches for different sets of TABLE or MAP statements, and they can be used within an individual TABLE or MAP statement to override any global settings for that particular MAP or TABLE statement.
The default is NOTRIMVARSPACES because the spaces in a VARCHAR column can be part of the data. Before using TRIMVARSPACES, make certain that trailing spaces are not required as part of the target data.
For Extract, TRIMVARSPACES only has an effect if Extract is performing mapping within the TABLE statement (by means of a TARGET statement).
Default
NOTRIMVARSPACES
Syntax
TRIMVARSPACES | NOTRIMVARSPACES
Examples
The following example uses TRIMVARSPACES and NOTRIMVARSPACES at the root level of the parameter file. The default of NOTRIMVARSPACES is in effect until the last MAP statement, to which TRIMVARSPACES applies.
MAP fin.src1, TARGET fin.tgt1; MAP fin.src2, TARGET fin.tgt2; MAP fin.src3, TARGET fin.tgt3; TRIMVARSPACES MAP fin.src4, TARGET fin.tgt4;
The following example uses TRIMVARSPACES within a MAP statement to override the global default of NOTRIMVARSPACES. The default applies to the first two MAP statements, and then TRIMVARSPACES applies to the last two targets.
MAP fin.src1, TARGET fin.tgt1; MAP fin.src1, TARGET fin.tgt2; MAP fin.src1, TARGET fin.tgt3, TRIMVARSPACES; MAP fin.src1, TARGET fin.tgt4, TRIMVARSPACES;