dbTalk Databases Forums  

AS400 Empty cell question

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss AS400 Empty cell question in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jayyde
 
Posts: n/a

Default AS400 Empty cell question - 02-10-2006 , 09:28 AM






Hello again!

Have a field coming in from an AS400 that's "empty" (if i highlight it
in kinda looks like there might be a space there, but no letter,etc.).
When it copies over to a varchar field in my staging table it doesn't
come over as null, but it apparently isn't coming over as a space
either or anything of the '\s' variety. Below are the two ways I've
tried to use to convert what is incoming (which is either a letter to
convert to 'Yes' or whatever the empty thing is to convert to '').

1)
// Convert the CustomFieldString2 to 'Yes'/EMPTY.
if (isString(DTSSource("CustomFieldString2")))
{
custString2 = "Yes";
}
else
{
custString2 = "";
}
function isString(sStr)
{
try
{
return sStr.constructor==String;
}
catch(ex)
{
return false;
}
}
***now this one makes everything, whether it contains a letter or not
empty ('').


2)
if (DTSSource("CustomFieldString2") == "" |
DTSSource("CustomFieldString2") == null)
{
custString2 = "";
}
else
{
custString2 = "Yes";
}

***and this one makes everything 'Yes'.

plz help! i've tried everything I can think of, and yes I've also
previously tried adding *.replace(/\s/g,"") in various places to see if
that fixes it and no go =(.


Reply With Quote
  #2  
Old   
Jayyde
 
Posts: n/a

Default Re: AS400 Empty cell question - 02-13-2006 , 08:37 AM






Really? No one knows what garbage they're throwing into that cell or
some check I can do to distinguish between it and what I need? I have
absolutely no AS400 experience, so I have absolutely no clue =\.


Reply With Quote
  #3  
Old   
Jayyde
 
Posts: n/a

Default Re: AS400 Empty cell question - 02-13-2006 , 08:47 AM



Really? No one knows what garbage they're throwing into that cell or
some check I can do to distinguish between it and what I need? I have
absolutely no AS400 experience, so I have absolutely no clue =\.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.