NULL vs EmptyString

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
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

NULL vs EmptyString

Post by poorna_76 »

We are reading data from XML file using XML Stage and loading into dataset.
In the XML stage specified the option 'Replace NULL's with EmptyValues & Replace EmptyValues with NULL's'

For 'MissingAttributes' in the XML file, we are getting NULL's in the dataset.
For EmptyString's (Code ='') we are getting EmptyString in the dataset.

Now the problem, we are facing is:

When we are processing the datasets, we were able to identify 'MissingAttributes' by IsNull() check,but we were not able to do the EmptyString check.


If IsNull(linkName.ColumnName) - works perfectly fine.
If (LinkName.ColumnName = '' OR LinkName.ColumnName = "") - does not work at all . even though i see a space in the dataset, datastage does not recognise this a EmptyString.

what could be the issue?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: NULL vs EmptyString

Post by chulett »

poorna_76 wrote:even though i see a space in the dataset, datastage does not recognise this a EmptyString.
A little lost. A space? If there's a space then you don't have an empty anything. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
umamahes
Premium Member
Premium Member
Posts: 110
Joined: Tue Jul 04, 2006 9:08 pm

Post by umamahes »

Then compare with space like below.
If (LinkName.ColumnName = " ") Then ... Else ..

Thanks
HI
poorna_76
Charter Member
Charter Member
Posts: 190
Joined: Thu Jul 08, 2004 10:42 am

Re: NULL vs EmptyString

Post by poorna_76 »

chulett wrote:
poorna_76 wrote:even though i see a space in the dataset, datastage does not recognise this a EmptyString.
A little lost. A space? If there's a space then you don't have an empty anything ...
Chulett,

Sorry for the confusion.
I don't see a space , i see it as empty string without any spaces.
Even if i do the Len(LinkName.ColumnName) i am getting the max length defined for that field as opposed to '0'.

For NULL's , i see as 'NULL' in the dataset without any issue.


Any help is greatly appreciated.
Post Reply