Testing for a numbers stored Char 18 field

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
tbtcust
Premium Member
Premium Member
Posts: 230
Joined: Tue Mar 04, 2008 9:07 am

Testing for a numbers stored Char 18 field

Post by tbtcust »

Hi all.

How can I test for a number stored Char field?

I need to locate records which have numeric values stored in a field where the value is less than 1000000. That field also contains alpha-numeric values as well. The field's data type is Char(1Cool and I'm sending the output to a Seq file.

I have coded NUM(Trim(in.FldName)) = 1 And Trim(in.FldName) < '1000000' as a transform stage constraint. I also coded NUM(Trim(in.FldName)) = 1 And StringToDecimal(Trim(in.FldName)) < 1000000. The output is very inconstant, e.g., output records with values > '1000000' and records with < '1000000' are missed.

How should this type of test be coded?


Thanks in advance for any help.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The field's data type is Char(1Cool? Disable 'Smilies' in your post.

Both Num() and IsValid() can be used to check for a number, depending on your need. And you need a numeric comparison, doing it string-wise a value of '1000000' is less than '90' for example.
-craig

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