User Defined Functions (for data conversion)?

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
jrdoucette
Participant
Posts: 1
Joined: Mon Jul 14, 2008 8:16 am
Location: Worcester MA

User Defined Functions (for data conversion)?

Post by jrdoucette »

I'm new at DS, so I appologise if this is a redundent question, but I could not find a suitable answer.

Is it possible to create my own function, specifically to reformat dates? I have close to 100 date fields requireing the same conversion, but over the course of the next two years, the source systems will be converted from SQL Server to Oracle and all the Iconv statement will need to to a redone.

I would like to put the logic in 1 place (a user defined function) and plug the function into the stages, then I need only update 1 line of code when the conversion is complete.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome! :D

What you need is a "User Defined" or custom routine, reusable code that encapsulates business logic. Create and test it in the Manager, then leverage it in the field derivations of your jobs. If your rules change, simply recode and redeploy the routine and all jobs that use it will automatically (and immediately) begin to use the modified code.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply