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
agpt
Participant
Posts: 151 Joined: Sun May 16, 2010 12:53 am
Post
by agpt » Fri Sep 10, 2010 1:32 pm
Hi,
I have Numerical+Characters data in the source in the same column. Data type is varchar and it has values like 19, 'ABC'. How will I load only Character data to the target?
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Sep 10, 2010 1:44 pm
What's your business rule?
-craig
"You can never have too many knives" -- Logan Nine Fingers
agpt
Participant
Posts: 151 Joined: Sun May 16, 2010 12:53 am
Post
by agpt » Fri Sep 10, 2010 1:49 pm
I need only alphabetic data out.
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Fri Sep 10, 2010 2:01 pm
Code: Select all
Convert(Convert("ABC...Zabc..z","",Str),"",Str)
You are the creator of your destiny - Swami Vivekananda
vinothkumar
Participant
Posts: 342 Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India
Post
by vinothkumar » Fri Sep 10, 2010 2:12 pm
Your column has values like ABCD123FGVH. In that you want to load only ABCDFGVH. Is that you mean in your post.
If Yes, use Convert('0123456789','',String).
agpt
Participant
Posts: 151 Joined: Sun May 16, 2010 12:53 am
Post
by agpt » Sat Sep 11, 2010 12:26 am
no no
what i meant
suppose i have 5 records like
abc
123
efg
rst
345
Then in put put i need only 3 records from above which would be
abc
efg
rst
how can I implement that?
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Sat Sep 11, 2010 3:15 am
Use a constraint something like Not(Num(Inlink.TheString))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
agpt
Participant
Posts: 151 Joined: Sun May 16, 2010 12:53 am
Post
by agpt » Sat Sep 11, 2010 5:52 am
ray.wurlod wrote: Use a constraint something like Not(Num(Inlink.TheString)) ...
Ray, but it's varchar column type so not(num()) is going to be true even for 123 value. right?
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sat Sep 11, 2010 6:41 am
Nope, it is testing the contents not the data type specifically. Give it a shot.
-craig
"You can never have too many knives" -- Logan Nine Fingers