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
rajeevm
Participant
Posts: 135 Joined: Sun Jan 22, 2006 10:44 am
Post
by rajeevm » Tue Nov 23, 2010 2:40 pm
Hi,
I need your help in finding the solution. I have a column called E_NO which is Varchar(20) from the source but sometimes it has numbers in it I mean 146700 .Before loading this into target I need to add DR to it . But how can I check the field has numeric data . If numeric then add DR to it else pass it on the same
I appreciate your replies.
Thanks
rajeev
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Tue Nov 23, 2010 2:53 pm
Code: Select all
If Str <> Convert('0123456789','',Str) Then Str : 'DR' Else Str
You are the creator of your destiny - Swami Vivekananda
rajeevm
Participant
Posts: 135 Joined: Sun Jan 22, 2006 10:44 am
Post
by rajeevm » Tue Nov 23, 2010 2:58 pm
Hi anbu
I need to add DR in front of the numeric data
For example : I have 145000 from the source data as it is numeric it should be loaded into the target as DR145000
I need to check in for the numbers if it is then I need to append DR in front of it else pass it on the same to the target
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Tue Nov 23, 2010 3:08 pm
Code: Select all
If Convert('0123456789 ','',Str) = '' Then 'DR' : Str Else Str
You are the creator of your destiny - Swami Vivekananda
rajeevm
Participant
Posts: 135 Joined: Sun Jan 22, 2006 10:44 am
Post
by rajeevm » Tue Nov 23, 2010 3:18 pm
Thanks anbu
It worked Now the numeric data has been into the target with DR in front of it .
Thanks a lot .I really appreciate it.
rajeev
Sreenivasulu
Premium Member
Posts: 892 Joined: Thu Oct 16, 2003 5:18 am
Post
by Sreenivasulu » Wed Nov 24, 2010 10:45 am
You can use the 'isvalid' function
Regards
Sreeni
mobashshar
Participant
Posts: 91 Joined: Wed Apr 20, 2005 7:59 pm
Location: U.S.
Post
by mobashshar » Wed Nov 24, 2010 10:58 am
You can also use AlNum function