How to handle string"000000000000000000000000000"

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kaushal.kumar@igate.com
Participant
Posts: 77
Joined: Tue Apr 14, 2009 4:03 am

How to handle string"000000000000000000000000000"

Post by kaushal.kumar@igate.com »

Hi ,
in my job input is a sequential file(output of some other job).One of the field is decimal(4,16).For null value this field takes "0000000000000"(16 zero).I need to handel this zero and make it as 0.Please advice me how to do this.
LavanyaRamesh007
Participant
Posts: 42
Joined: Mon Apr 21, 2008 1:49 am

Post by LavanyaRamesh007 »

Hi ,

If your requirement is to handle just a fixed width string "000000000000000000000000000"
then just add a simple if INPUT_VALUE="000000000000000000000000000" then 0 else INPUT_VALUE
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That zero already is a zero - simply moving it to a number field should "handle" it just fine. What issue are you having? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

All zeroes is not, by default, legal for Decimal data type.

There is something you can set (environment variable?) that allows DataStage to accept all zeroes for a decimal number.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That sounds vaguely familiar but no clue where that setting would be. Would not "math" also fix that, for example multiplying by 1?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's the fix_zero argument to the conversion functions.
Parallel Job Developer's Guide p628 wrote:By default decimal numbers comprising all zeroes are treated as invalid. If the string fix_zero is specified as a second argument, then all zero decimal values are regarded as valid.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... that's why it sounded vaguely familiar - you're talking PX and this is a Server issue. Perhaps even a Server non-issue.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:oops:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kaushal.kumar@igate.com
Participant
Posts: 77
Joined: Tue Apr 14, 2009 4:03 am

Post by kaushal.kumar@igate.com »

Thanks for help.I have to check my job once i will be in office on monday and let you know wheather my problem is resolved or not.
Post Reply