processing

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
kris_daredevil
Participant
Posts: 20
Joined: Mon Dec 05, 2005 8:07 pm
Contact:

processing

Post 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
KRIS
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post 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.
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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post 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.
kris_daredevil
Participant
Posts: 20
Joined: Mon Dec 05, 2005 8:07 pm
Contact:

Post 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
KRIS
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post 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.
Post Reply