Page 1 of 1

processing

Posted: Wed Oct 18, 2006 9:47 am
by kris_daredevil
Hi All,

Is it good practice to do transformation into one variable
e.g trim(ereplace(DSLINK.col1," ","-")
or do
trim(DSLINK.col1)=variable1
ereplace(variable1," ","-") =variable2


how does the process work in both the cases :?:

thanks
kris

Posted: Wed Oct 18, 2006 9:54 am
by kcbland
Ignoring that your examples give different results (trim and ereplace vs. ereplace and trim), it's perfectly fine to nest functions, just keep your logic legible. Consider using stage variables when the same derivation of a value is repeated for many columns, or you need to simply a derivation/constraint.

Posted: Wed Oct 18, 2006 9:59 am
by ArndW
The first one performs only one variable assignment, the second one needs to do 2; so the first will be more efficient. As Ken has stated, they will in their current form give different results.

Posted: Wed Oct 18, 2006 10:09 am
by DeepakCorning
Your first scenario does not match with the second one, so my guess is that you are talking about nesting many functions tgether and performace wise which one is better? I think nesting is perfectly well and performance wise I have not seen any jobs which perform bad if they have nested function.

Posted: Wed Oct 18, 2006 10:36 am
by kris_daredevil
Thanks All,

Assuming both the results give the same output .
iam sorry for posting wrong way.
iam just intrested in knowing how the internal process works is their any kind of documentation links or .pdf where i can know how the datastage processes the incomming data with the stages.


thanks once again for replies.. :)


kris

Posted: Wed Oct 18, 2006 1:02 pm
by meena
Hi Kris,
There may be many ways to write a code.But need to check which is the fastest.Mean to consider the performace of a job.And Online documentation or .pdf files are available when you install the Datastage on your system.