Hi,
I have got a problem in the constraint part.Here I have to pass only those values from the transformer whose 6th letter is char and 5th letter is numeric. The filed is EMP_ID varchar 30.
I have used Alpha(column[6,1]) and Num (column[5,1]) in the constraint.Now no records are passing and its throwing warnings :Null Value Arguement.
Can any one help me to check these warning and also let me know whether I have done the right thing.
Regards
Arnie.
Problem in constraint/checking for alphabatic and numeric
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If EMP_ID can be null from source you must handle this explicitly. Functions such as Alpha() and Num() can not accept null arguments.
Calculate stage variable svEmpIdTest as follows.
Your constraint then has the form
The actual values do not matter, provided that they are distinct. Use TinyInt as the data type of the stage variable if you choose to use -1, 0 and 1.
Calculate stage variable svEmpIdTest as follows.
Code: Select all
If IsNull(InLink.EMP_ID) Then -1 Else If Alpha(InLink.EMP_ID[6,1]) And Num(InLink.EMP_ID[5,1]) Then 1 Else 0
Code: Select all
svEmpIdTest = 1
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
ray.wurlod wrote:If EMP_ID can be null from source you must handle this explicitly. Functions such as Alpha() and Num() can not accept null arguments.
Calculate stage variable svEmpIdTest as follows.Code: Select all
If IsNul ...[/quote] The null is handled and EMP_ID is coming as unicode so I have done UstringTostring on it. The exact warning is: APT_CombinedOperatorController,0:Nullstringarguement Can u plz tell why am I getting this warning? I need to get rid of them. Regards Arnie
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You may have quite a wait until U logs in again; he hasn't posted in a while (but may still be lurking). Why do you specifically want U to help in any case? U's profile shows only beginner level.
And is plz somewhere in eastern Europe or the Balkans?
And is plz somewhere in eastern Europe or the Balkans?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: