transformation

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

smohd1338
Premium Member
Premium Member
Posts: 28
Joined: Fri Aug 03, 2012 1:09 pm

transformation

Post by smohd1338 »

Hi, if in input field, "Change Section Design" i need output as CSD , the first letter of each word in the input.how do i dot his?
sameer
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

is space only the delimiter for the words?
is three words the maximum?
Thanks,
Prasanna
smohd1338
Premium Member
Premium Member
Posts: 28
Joined: Fri Aug 03, 2012 1:09 pm

Post by smohd1338 »

yes, sapce is the only delimeter, but its not just 3 words, it can be 4, or words or 2 or 1, input may also come lilke "input may also come lilke" then output is IMACL
sameer
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

For now i can think like this. Considering the maximum number of words as n.

Code: Select all

   LEFT (FIELD (lnkIp.ip_column, " ", 1), 1)
|| LEFT (FIELD (lnkIp.ip_column, " ", 2), 1)
|| LEFT (FIELD (lnkIp.ip_column, " ", 3), 1)
.
.
.
|| LEFT (FIELD (lnkIp.ip_column, " ", N), 1)
I dont think we can loop in some way.
This is the option to get first character of a string.
Thanks,
Prasanna
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

There must be a size for the input column so we can somehow conclude the value N.
And in the above solution irrespective of any number of words in input it will gives us result
Thanks,
Prasanna
smohd1338
Premium Member
Premium Member
Posts: 28
Joined: Fri Aug 03, 2012 1:09 pm

Post by smohd1338 »

the size is 150 varchr coming in input, looks liek the value of N can be anythng between 1-10 mostly
sameer
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Hi,
If you are in version 8.5 and above,you can use the power of transformer caching.
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

yeah you know the data very well. you can repeat the function any number of times. guess 25 will be better
Thanks,
Prasanna
smohd1338
Premium Member
Premium Member
Posts: 28
Joined: Fri Aug 03, 2012 1:09 pm

Post by smohd1338 »

I am using 8.1
sameer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That would be pretty trivial in a Server routine. Any chance of using a BASIC Transformer in your job?
-craig

"You can never have too many knives" -- Logan Nine Fingers
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

Hmm i expected this. Can you explain how we are acheiving it in higher version
If you are in version 8.5 and above,you can use the power of transformer caching.
Last edited by prasannakumarkk on Tue Mar 19, 2013 9:26 am, edited 1 time in total.
Thanks,
Prasanna
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use BASIC Transformer stage and Oconv(InLink.TheString, "MCT")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ray, isn't that the same as CAPITALS? If so they just the first letter of each word, not the first letter of each word capitalized. If I am mis-remembering what "MCT" does, forgive me...
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

CAPITALS is a Transform that encapsulates Oconv(%Arg1%, "MCT")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's what I thought... meaning it won't solve their problem. :wink:
-craig

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