NullToValue

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
sush26283
Participant
Posts: 68
Joined: Thu May 20, 2010 11:55 am

NullToValue

Post by sush26283 »

I have an issue need some insight..
i have a job with one of the source column as NOT NULL and its been targeted to a column that is also NOT NULL..the data coming in on that column shows blank, null spaces, I want to default those blank spaces to UNKNOWN. but when I use the NullToValue function, I still get the same plain blank space at the target column. how can I handle it. someone please give some insight.

both the columns are defines as Varchar(25) and the data coming in are numeric like '2', '7', etc..
thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

An empty string "" is not the same as null. Sounds like you need to explicitly check for that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Blanks or spaces are not equivalent to the NULL value, which represents that the value is UNKNOWN.

In your case, you won't have actual NULL values coming in. You can do a test on spaces or a test on the empty string '' (two single quotes) after trimming the VarChar(25) column, and then output the string 'UNKNOWN' or else output the original input column value.
Choose a job you love, and you will never have to work a day in your life. - Confucius
sush26283
Participant
Posts: 68
Joined: Thu May 20, 2010 11:55 am

Post by sush26283 »

chulett wrote:An empty string "" is not the same as null. Sounds like you need to explicitly check for that. ...
so what exactly do I need to do..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Read Eric's post.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sush26283
Participant
Posts: 68
Joined: Thu May 20, 2010 11:55 am

Post by sush26283 »

Thanks you Eric, that was great help...I was able to resolve the issue with what you told me..Thank You SIR!!!! :D
Post Reply