When renaming a column the data is not unloaded and loaded to the renamed column using RC/Migrator
search cancel

When renaming a column the data is not unloaded and loaded to the renamed column using RC/Migrator

book

Article ID: 144048

calendar_today

Updated On:

Products

RC/Migrator for DB2 for z/OS RC Compare for DB2 for z/OS

Issue/Introduction

Altering a table in a RC/Migrator for Db2 for z/OS (RCM) 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.