When renaming a column the data is not unloaded/loaded to the renamed column

book

Article ID: 144048

calendar_today

Updated On:

Products

CA RC Compare for DB2 for z/OS CA Database Management for DB2 for z/OS - Administration Suite CA Endevor SCM Interface for DB2 for z/OS CA Endevor SCM Interface for Remote DB2 for z/OS CA RC/Extract for DB2 for z/OS CA RC/Migrator for DB2 for z/OS CA RC/Merger for DB2 for z/OS CA RC/Query for DB2 for z/OS CA RC/Secure for DB2 for z/OS CA RC/Update for DB2 for z/OS

Issue/Introduction

Altering a table in a Compare strategy, a column is renamed, however the data is not loaded to the renamed column.

Why is the data not being unloaded from the old column to the newly named column?

Resolution

The cause of this problem is likely because the correct column mapping has not been specified in the maskset used by this strategy.

In the maskset, if you have specified mapping 'COLNAME = =', only columns with the same name will be mapped together. This means that when you rename a column, then the new column will not be mapped to the old column. So RC/Compare is treating the renamed column as a new column. This should be evident in the Impact Analysis in your Analysis Report:

------------ Table Column Changes --------------------
Attribute Status Value
--------- ----------- ----+----1----+----2----+----3--
NAME Currently: (INSERTED)
Changed To: new-column-name 
...

NAME Currently: old-column-name 
Changed To: (DELETED)

So new-column-name is being inserted and old-column-name is being deleted.

The generated unload and load cards reflect this and so the data from old-column-name is not unloaded and no data is loaded into new column new-column-name.

To resolve this you need to map the new and old column names together using the maskset.

After updating or creating a new maskset, you then need to update the strategy to pick up the changed maskset.

Then when you analyze the strategy, the Impact Analysis will show that the column is being renamed

------------ Table Column Changes --------------------
Attribute Status Value
--------- ----------- ----+----1----+----2----+----3--
NAME Currently: old-column-name 
Changed To: new-column-name

Also the unload and load cards will now reflect that the column is being renamed

So when renaming a column it is necessary to use column mapping in your maskset otherwise RC/Compare treats it as a column delete and insert.