Convert Reusable transformation Logic.

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sksdsx
Participant
Posts: 12
Joined: Fri Jan 31, 2014 9:40 am

Convert Reusable transformation Logic.

Post by sksdsx »

Hi Experts,

we have a requirement to perform similar transformation on most of the incoming fields.

i.e. If IsNull(Lnk.col1) the SetNull() else StringToDate(Lnk.col1,"%yyyy%ddd")


as there are more than one field need to have similar derivation in multiple jobs. Just wanted to explore is there a simpler way to convert this into a function and pass Lnk.col1 as parameter.

We are exploring to convert it into routine but writing this code in C++ is bit tedious.

Please Advice!

Appreciate your time.
To succeed in life, you need two things: ignorance and confidence--Mark Twain
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

This will not directly answer your question, however...

Are you aware of the derivation substitution feature? You can, for instance, select multiple columns (dozens or hundreds), right-click, and apply the same derivation to all selected columns in a single step.
Choose a job you love, and you will never have to work a day in your life. - Confucius
sksdsx
Participant
Posts: 12
Joined: Fri Jan 31, 2014 9:40 am

Post by sksdsx »

Hi ,

Thanks for your response. I am aware of derivation substitution currently we are using same mechanism but it would simplify the derivation if we could pass just the <field> as an argument and would be easy to read.

Similar to NullToEmpty function.

I have tried creating a custom transform but in derivation part StringToDate function is not recognised.

It says variable 'StringToDate' not defined.

Would appreciate your help!
To succeed in life, you need two things: ignorance and confidence--Mark Twain
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

StringToDate is a parallel function. You need to stick with Server functions in the transform, for example IConv/OConv... but then you could only leverage it in a Server Shared Container or a Server job proper.

Unless I'm not understanding what you mean by 'transform'. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sksdsx
Participant
Posts: 12
Joined: Fri Jan 31, 2014 9:40 am

Post by sksdsx »

Hi Chulett,

Thanks, this helps , Please correct me if I am wrong transform can only be written with help of server functions and we cannot leverage it, with parallel jobs .

Apart from Parallel routine are there any other option to achieve this.

Would appreciate any pointers/clues .

Thanks In Advance!
To succeed in life, you need two things: ignorance and confidence--Mark Twain
sksdsx
Participant
Posts: 12
Joined: Fri Jan 31, 2014 9:40 am

Post by sksdsx »

The only solution to this to generate a parallel routine.
To succeed in life, you need two things: ignorance and confidence--Mark Twain
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Only? No.
-craig

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