All zeros

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
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

All zeros

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

InLink.TheString = Convert("0", "", InLink.TheString)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post 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.
Nagac
Premium Member
Premium Member
Posts: 127
Joined: Tue Mar 29, 2011 11:39 am
Location: India

Post by Nagac »

Thanks Ray & zulfi. I will check this
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A signed zero is a very unusual thing.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply