replacing an empty value in the datastage
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 315
- Joined: Tue Oct 31, 2006 3:38 pm
replacing an empty value in the datastage
I have some NULL and empty values in column of file. I want to replace both of the values to some numeric value. I can replace a NULL with a value but i cannot for the empty one. Iam using If then else in datastage. Can anybody help me.
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
I am not sure but yu can do something like this:
Sam
Code: Select all
If IsNull(link.col) then '16161' elseif len(link.col)=0 then '2332' else link.col
-
- Premium Member
- Posts: 315
- Joined: Tue Oct 31, 2006 3:38 pm
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Play around with this:
In previous post there should be space between else and if.
Sam
Code: Select all
If (IsNull(link.col) OR len(link.col)=0) then 'XXX' else link.col
Sam
You could have done a little changes and checked yourself.
Use else if instead of elseif
Does that work?
Use else if instead of elseif
Code: Select all
If IsNull(link.col) then '16161' else if len(link.col)=0 then '2332' else link.col
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.
-
- Premium Member
- Posts: 315
- Joined: Tue Oct 31, 2006 3:38 pm
-
- Premium Member
- Posts: 315
- Joined: Tue Oct 31, 2006 3:38 pm
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Premium Member
- Posts: 315
- Joined: Tue Oct 31, 2006 3:38 pm
-
- Premium Member
- Posts: 315
- Joined: Tue Oct 31, 2006 3:38 pm
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Premium Member
- Posts: 315
- Joined: Tue Oct 31, 2006 3:38 pm
What Sam is trying to tell you here is to try open the file and find out if you can decipher these "small squares".
Do you have cygwin or similar tools installed? If yes you can vi the file and easily find out if these characters are carriage returns or not.
I dont know a way to figure this out in windows.
May be some windows expert can comment on this.
Do you have cygwin or similar tools installed? If yes you can vi the file and easily find out if these characters are carriage returns or not.
I dont know a way to figure this out in windows.
May be some windows expert can comment on this.
Narasimha Kade
Finding answers is simple, all you need to do is come up with the correct questions.
Finding answers is simple, all you need to do is come up with the correct questions.