Numeric check & conversion

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nani0907
Participant
Posts: 155
Joined: Wed Apr 18, 2007 10:30 am

Numeric check & conversion

Post by nani0907 »

Hi,

If a value in a column is not a numeric ,i need to convert it to Sting 'NULL' .How can we implement this is effective way.mysource is csv file.

Please advice
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Depends. What is your definition of "numeric"? Does it include all of the following?
24
17.32
-8.92
6.023E23
-1.551E-15

You can use an appropriate testing function, perhaps Num() to determine whether the string (note, not "sting") is numeric based on your rules, within an If..Then..Else construct, and use SetNull() to generate the null if required.
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 »

As noted, it depends on both what you consider to be "numeric" and the nature of the data to be checked. Can you be more specific? Post some examples of both "good" and "bad" data in the field.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply