Page 1 of 1

All zeros

Posted: Sat Apr 30, 2011 6:07 pm
by Nagac
Hi

Can we find whether the field is having all zeros/spaces?. I need to write default value if the field is with zeros/spaces.

Posted: Sat Apr 30, 2011 11:11 pm
by ray.wurlod

Code: Select all

InLink.TheString = Convert("0", "", InLink.TheString)

Posted: Sun May 01, 2011 3:40 am
by zulfi123786
If Len(Convert(" ","",(Convert("0", "", InLink.TheString))))=0 then <default> else InLink.TheString

Same thing as mentioned by Ray with little more garnishing :)

Recheck to make sure the '+' ve sign is not prefixed for positive numbers, which usually is not the case.

Posted: Sun May 01, 2011 4:04 am
by Nagac
Thanks Ray & zulfi. I will check this

Posted: Sun May 01, 2011 1:04 pm
by ray.wurlod
A signed zero is a very unusual thing.

Posted: Mon May 02, 2011 8:06 am
by FranklinE
ray.wurlod wrote:A signed zero is a very unusual thing.
EBCDIC '0C' is packed decimal +0, a rather common thing in many mainframe data repositories. Data attributes that include an explicit sign often require +0 as the default value. This is true in Cobol standards (when they are followed).

Of course, unsigned zeroes are often just undiscovered. The NBA is always looking for them. ("0" or "00" being a common number for centers.)

:P