Search code examples
datastage

can a modify stage bulk rename columns based on wildcards?


I need to modify columns based on business rules using RCP. For example, all source columns that end with '_ID' must be changed to '_KEY' to meet the target.

An example: Test_ID in source becomes Test_KEY in target

I have multiple tables, some with 2 "ID" columns, and some with 20. Is there a way to configure the modify stage to bulk rename columns based on wildcard?

If not, is there another way?

Thanks.


Solution

  • I doubt that there is an option using modify stage with wildcards for this.

    One alternative could be a schema file which can be used with any of following stages: Sequential File, File Set, External Source, External Target, Column Import, Column Export

    This schema file could also be generated or modified to adjust the column names as needed.

    Another way could be to generate the appropriate SQL statement if the data resides in a database or is written to one.