transforms functions and routines

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
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

transforms functions and routines

Post by kollurianu »

Hi All,

Can some one tell me what is difference in Transform Function and
Function from Routine Category.

What is the main difference between Transforms and Routines?

Please Asap.

Thank you
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

The main difference is that transform functions are substituted at code generation time, whereas routines are called at execution time.

If you can easily do something in a transform function, you may see a performance benefit versus implementing the same task as a routine, since you are eliminating the overhead of the call.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Transforms are just 1 line DS BASIC logic that can be used inside your job in a derivation or constraint expression. When pre-compiling, the Transform name is expanded to the full logic expression stored. This means that if you change the logic in a Transform, all jobs using it must be recompiled.

A Function is a separate code-object that can be extended, expanded, revised, etc, without requiring recompiling jobs that use it. It also has the ability to be many lines long, has an excellent Test facility, as well as has the ability to do much with the rich DS BASIC language.

Use the one that works best for you. Someone will tell you that Transforms are faster because they are not Functions, and that is true if you compare a one line Function against a Transform. But, a 30 line Function can't be done in a Transform.

Use your judgement.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Transform is in-line function whereas Routine is external call for each row.
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Thank you all for ur answers.
Post Reply