Need to Perform Logic in Transformer

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

DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post 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
Thanks in advance,
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

Is the above correct?

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

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post 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....
Thanks in advance,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

"ALNUM" is a datastage string function for checking if a field is all Numeric.
Thanks in advance,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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).
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's an alphanumeric check which is NOT what you want. Look at Num() or IsValid() as a couple of other options.
-craig

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