How easily we can give funciton in DRS stage of 80 columns

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
rajiivnb
Participant
Posts: 77
Joined: Fri Sep 10, 2004 8:38 am
Location: India

How easily we can give funciton in DRS stage of 80 columns

Post by rajiivnb »

Hi,

Am using RTRIM and LTRIM functions in the DRS stage. I have nearly 80 char type columns. i feel very difficult to give this function to all the columns. So, can any one tell me the best way to implement this function easily in a DRS stage.

it will reduce my effort
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

There is not shortcut for doing this. The most you can do is use the user defined sql and do you text modification using any text editor of your choice and paste it back once you finished.

You can add this feature in the wishlist for ascential to make us lazy

Thanks
Siva
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Do it in a transformer. Put in your input columns and your output columns, automap them together in the transformer. Highlight every derivation column in the right hand side of the transformer window and choose Derivation Substitution from the right mouse menu, replace the whole expression with RTRIM(LTRIM($1)) to add the function to every derivation.

Also consider putting RTRIM(LTRIM into a routine, that way you can add more handling to it later such as null value, date checking, funny character checking etc.

The search and replace functions in transformers are worth getting to know.
Post Reply