Problem in constraint/checking for alphabatic and numeric

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
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

Problem in constraint/checking for alphabatic and numeric

Post by arnie_nits »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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 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 
Your constraint then has the form

Code: Select all

svEmpIdTest = 1
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

Post by arnie_nits »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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?
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 »

Not sure how you can say "the null is handled" when your error is "Nullstringarguement". What do you have in the way of null handling at this point?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Disabling operator combination, at least temporarily, will allow you to narrow the focus of your diagnostic investigation.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply