Page 2 of 2

Posted: Thu May 30, 2013 10:59 am
by DS_MJ
I tried to do the following in the stage variable:

If NOT AlNum(LEFT(Lnk_Extract_Xrfm.MEMBNO,3))
then LEFT(Lnk_Extract_Xrfm.MEMBNO,3)
Else
If NOT AlNum(LEFT(Lnk_Extract_Xrfm.MEMBNO,2))
Then LEFT(Lnk_Extract_Xrfm.MEMBNO,2)
ELSE
IF NOT AlNum(LEFT(Lnk_Extract_Xrfm.MEMBNO,1))
Then LEFT(Lnk_Extract_Xrfm.MEMBNO,1)
ELSE ' '
Endif
Endif
Endif

However, during validate derivation its highlighting the function ALNUM ...any help would be appreciated.


Thanks

Posted: Thu May 30, 2013 12:02 pm
by DS_MJ
Is the above correct?

Thanks

Posted: Thu May 30, 2013 12:48 pm
by chulett
Apparently not if the function isn't valid, never mind that you don't want to check for alphanumerics. That includes number and letters, you just want a numeric check.

Posted: Thu May 30, 2013 1:06 pm
by DS_MJ
When I look at the data for this field I see that the first 3 one can expect to see Char fields and rest numbers.
So if only numbers come in then put spaces else extract the character.
Hence the need to check for All Numerics only....

Posted: Thu May 30, 2013 1:57 pm
by chulett
I don't have my documentation here. Is AlNum a custom function at your shop? I'm assuming that "Al" means "Alpha" and thus it is an ALphaNUMeric check rather than an "All Numerics" check. Hence my earlier reply.

Posted: Thu May 30, 2013 3:41 pm
by DS_MJ
"ALNUM" is a datastage string function for checking if a field is all Numeric.

Posted: Thu May 30, 2013 7:30 pm
by ray.wurlod
DS_MJ wrote:"ALNUM" is a datastage string function for checking if a field is all Numeric.
No it isn't. Alnum() is a built-in DataStage function that reports whether a string of characters is wholly alphanumeric. Num() reports whether the string of characters validly represents a number (but this can include decimal placeholder).

Posted: Thu May 30, 2013 9:36 pm
by chulett
As noted: it's an alphanumeric check which is NOT what you want. Look at Num() or IsValid() as a couple of other options.