AlNum Function Giving Me Headaches

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
Tampa_Indy
Participant
Posts: 23
Joined: Tue Aug 04, 2015 12:45 pm

AlNum Function Giving Me Headaches

Post by Tampa_Indy »

I am trying to run the following:

if alNum(left(trim(<string>),1)=1 and length(trim(<string>)) > 1 then SetNull() Else <string>[2,10]

However, it is not working?! Any idea what I am doing incorrectly? I removed everything except AlNum(<string>)=1 then setnull() else <string>[2,10] but that does not appear to work either??
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why don't we start by you spelling out in words what it is you are trying to accomplish, your requirements here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Tampa_Indy
Participant
Posts: 23
Joined: Tue Aug 04, 2015 12:45 pm

Post by Tampa_Indy »

I am trying to distinguish non-numeric values with alphanumeric ones. For example, if you have the following values:

#
^345
* 999
STRK
STLM
Close*tome

I would want to completely remove '#', have a field contain '345' and ' 999' and a different field with 'STRK' 'STLM' and 'Close*tome'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... if the first character is alphanumeric then do something else do something else? And not at all clear on what you mean by "a different field".

What about your expression "is not working"? To me it looks like you want to set the result to NULL if the first character is alphanumeric and there is more than one character in the string, otherwise the result is everything minus the first character.
-craig

"You can never have too many knives" -- Logan Nine Fingers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

as per the expression you posted if the first character of the string is alpha numeric and the string is more than one character long then setnull() else take last 9 characters. which doesn't sound same as the example you provided. Can you be more clear on requirement?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply