Can't handle the 7 digits figure???

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Can't handle the 7 digits figure???

Post by ICE »

Hi All,

I have being one more problem encounter.
Now I am trying to validate the data across DB2 and AS400 after loading the AS400 data to DB2 datawarehouse.
One of the column is sales data column.I try to chk the data by substracting the data from (summation of DB2 - summation of AS400) .The substration result is correct. I get 0.00 coz there is same value.But when I try to compare as "If(DSLink6.New1=0) then 0 else 1 " ,the result is 1.So that means there is different value between them.But they are same figures between DB2 sales and AS400 sales.Also I have been got the substration result as 0.00.So I suspect the values and chk.The value till 6 digits(for ex : 100000) is fine.But if the value reach 7 digits as (1000000),I got the wrong compare result as '1' .So what should I do???Could u pls give me some suggestion???I have been used the larger data type.But still it doesn't work.

Any suggestion pls,

Thanks,
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Re: Can't handle the 7 digits figure???

Post by loveojha2 »

ICE wrote:Hi All,

I have being one more problem encounter.
Now I am trying to validate the data across DB2 and AS400 after loading the AS400 data to DB2 datawarehouse.
One of the column is sales data column.I try to chk the data by substracting the data from (summation of DB2 - summation of AS400) .The substration result is correct. I get 0.00 coz there is same value.But when I try to compare as "If(DSLink6.New1=0) then 0 else 1 " ,the result is 1.So that means there is different value between them.But they are same figures between DB2 sales and AS400 sales.Also I have been got the substration result as 0.00.So I suspect the values and chk.The value till 6 digits(for ex : 100000) is fine.But if the value reach 7 digits as (1000000),I got the wrong compare result as '1' .So what should I do???Could u pls give me some suggestion???I have been used the larger data type.But still it doesn't work.

Any suggestion pls,

Thanks,
Can you check the EXACTNUMERIC in uvconfig file?(Is it 7 or less, if yes try increase it.)
Or Do a string comparison to check equality of the two values. (If this serves)
What do you mean by
If(DSLink6.New1=0) then 0 else 1
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Re: Can't handle the 7 digits figure???

Post by ICE »

HI,

I have been checked in the uvconfig file but I didn't see any configuration.
Where can I increase the numeric value size.

Now I am using Decimal(15,2) data type.I have been used Double data type.But still not working.

This coding " If(DSLink6.New1=0) then 0 else 1 " means:

I am trying to compare the sales data result.
First I substract the values like (DB2_Sales-AS400_Sales).This values come to DSLink6.New1 .Then I compare the result(DSLink6.New1) with 0 as above......

Any idea pls,

Thanks,





loveojha2 wrote:
ICE wrote:Hi All,

I have being one more problem encounter.
Now I am trying to validate the data across DB2 and AS400 after loading the AS400 data to DB2 datawarehouse.
One of the column is sales data column.I try to chk the data by substracting the data from (summation of DB2 - summation of AS400) .The substration result is correct. I get 0.00 coz there is same value.But when I try to compare as "If(DSLink6.New1=0) then 0 else 1 " ,the result is 1.So that means there is different value between them.But they are same figures between DB2 sales and AS400 sales.Also I have been got the substration result as 0.00.So I suspect the values and chk.The value till 6 digits(for ex : 100000) is fine.But if the value reach 7 digits as (1000000),I got the wrong compare result as '1' .So what should I do???Could u pls give me some suggestion???I have been used the larger data type.But still it doesn't work.

Any suggestion pls,

Thanks,
Can you check the EXACTNUMERIC in uvconfig file?(Is it 7 or less, if yes try increase it.)
Or Do a string comparison to check equality of the two values. (If this serves)
What do you mean by
If(DSLink6.New1=0) then 0 else 1
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

I have been checked in the uvconfig file but I didn't see any configuration.
Where can I increase the numeric value size.
Search EXACTNUMERIC in uvconfig file, you will find it there.
I am trying to compare the sales data result.
First I substract the values like (DB2_Sales-AS400_Sales).This values come to DSLink6.New1 .Then I compare the result(DSLink6.New1) with 0 as above......
Instead you can use DB2_Sales=AS400_Sales to check their equality treating them as strings.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Hi loveojha2,

I don't see any "EXACTNUMERIC" in uvconfig file.I have been checked in both uvconfig and uvconfig.h file.But not see.

Yeah ,I have been used this direct checking first.It didn't work .So I try to substract them first and try to compare.But it also not working.
If the value is withing 6 digit as 100000,I can compare directly or checking after substracting.But if it is 7 digit values,I can't use both 2 ways.

Is there any other idea???Any suggestion pls.

Thanks 4 ur help,




loveojha2 wrote:
I have been checked in the uvconfig file but I didn't see any configuration.
Where can I increase the numeric value size.
Search EXACTNUMERIC in uvconfig file, you will find it there.
I am trying to compare the sales data result.
First I substract the values like (DB2_Sales-AS400_Sales).This values come to DSLink6.New1 .Then I compare the result(DSLink6.New1) with 0 as above......
Instead you can use DB2_Sales=AS400_Sales to check their equality treating them as strings.
loveojha2
Participant
Posts: 362
Joined: Thu May 26, 2005 12:59 am

Post by loveojha2 »

In place of
DB2_Sales=AS400_Sales
Use
DB2_Sales : "" =AS400_Sales : ""
This will make sure that comparison is of strings not of numeric values.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ice,

Doing floating point match is always imprecise, but I don't see how that could be affecting you here. If you change your job to write to a temporary sequential file and put the columns DB2Summation, AS400Summation and DB2Summation-AS400Summation into it, what results to you get for the difference which are wrong?
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear All,

When I try to compare directly,it doesn't work even if I use char data type.When I use txt file as intermediate acceording to ArndW's advise,it works fine.Thank you so much for all of ur help.



Thanks in advance,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Hmmm... this is odd. I am not sure what the problem was and my only suggestion was to find out more about the error, I'm surprised it solved anything. I would very much like to understand this. What did the output file show as the numbers and result?

DataStage will always attempt implicit conversions to and from datatypes so the conversions should either have generated warning messages or at least produce some numeric output.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear ArndW,

Yes,I really want to know how to solve it without using intermeidate txt file.But I really don't know how to solve it.
If the value is <1000000.00(it 6 digits.for example: if(100003.22-(100001.42+1.80)) <>0 then 1 else 0) ,the DS job can compare correctly.So the result is 0 coz of same val.But if the value is >=1000000.00(for ex : if(1000003.22-(1000001.42+1.80)) <>0 then 1 else 0),I get the result as 1.Actually it should be 0.Right?Coz it's same value.That's why I said the DS job can't handle the 7 digit figure.I don't know how to solve it.Do u have any idea ???Can I solve it without using txt file.I already used the following ways.

1 . I compare the valure directly as :
if(1000003.22<>(1000001.42+1.80)) then 1 else 0.
But I got the result as 1.It should be 0.

2.I used the above way
if(1000003.22-(1000001.42+1.80)) <>0 then 1 else 0.
But I got the result as 1

3.I substracted the value first and then compare them in the next transform stage as follows :
Transform 1 :1000003.22-(1000001.42+1.80)
I got the result as 0.00.SO the result is correct in this stage.
Then I compare that result in the next transform as follows:

Trasform1.val<>0 then 1 else 0.But I got the result as 1.
So I tried again as Trasform1.val<>0.00 .but I get the same result.

But if I used the 6 digit values,the result is always correct.Whenever I used the value as 7 digit figure,the result is always incorrect.

Do u get what the problem is?
Do u have any other idea pls???

The above is my testing script.In my real job,I got this strange result as above scenario.The sales figures(DB2,AS400) are same but I got the result as Error when I tried to compare them.So I suspect the value figure and tested with hard coding in another job.That time I found this strange thing.

I forgot to say.
When I use the txt file as intermediate.The sales figure are same as before. DB2 sales as 1000003.22 and AS400 sales as 1000003.22.But when I extract them from txt file and compare them,DS transformer work properly.I got the result as 0.It's correct .What's the matter it is???


Could u pls help me to solve it???

Any suggestion pls.

Thank u so much,







ArndW wrote:Hmmm... this is odd. I am not sure what the problem was and my only suggestion was to find out more about the error, I'm surprised it solved anything. I would very much like to understand this. What did the output file show as the numbers and result?

DataStage will always attempt implicit conversions to and from datatypes so the conversions should either have generated warning messages or at least produce some numeric output.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This is difficult to answer. You keep on testing for equality and check only for true or false - there is little additional debugging possible. Please tell us what the results are for A-B when both A and B are 7 or more digits. Is the result '0.00001' or '6.02E23'?
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Nope.The result is 0.00 coz my precision is 2.So the result is (0.00).
But now I get the solution.I convert the value to integer using Int function before I compare them.Now the coparision is ok.

This idea I get it from your suggestion.
You said that the floating point numbers are difficult to compare.Right?
Thank u so much.

Thanks for all of u all suggestions.



ArndW wrote:This is difficult to answer. You keep on testing for equality and check only for true or false - there is little additional debugging possible. Please tell us what the results are for A-B when both A and B are 7 or more digits. Is the result '0.00001' or '6.02E23'?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are you getting untranslated EBCDIC data from the AS400 or ASCII?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

May I know what is EBCDIC data?My data is Decimal(9,2) field.
I think that's because of floating point comparasion.It's imprecise.
Now that's no problem at all when I make type cast to int.


Thank u so much,

ray.wurlod wrote:Are you getting untranslated EBCDIC data from the AS400 or ASCII?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you don't know it probably isn't relevant. EBCDIC and ASCII are two different ways (encodings) for representing characters in computers.
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