11-23-2012 01:35 AM
I have a mainframe code which we suppose to migrate to windows environment.
We have successfully run the code and there were no errors.
As the problem here is in mainframes it reads 1019 rows and in windows it reads 1023 rows.
because the code has comparision with fractional number . please find the example code below....
infile ..... (path);
x commax8.1; /*here x is user defined variable which is used for calculations.*/
if y ne 0 then do;
if y ne 0 and z ne 0 and abs(x)>20;
and the sample values are numeric values 1-5 digit number.
when the logic is getting executed i can see it has accepting some fractional value of x as greater than 20 . ( 20.0001).
I have tried using different functions. round , ceil but. I cant get exact rows...
can any one please help..
11-23-2012 07:37 AM
The difference between the mainframe result and the Windows result lies in the slightly different way in which numbers are represented in the operating system as floating point 8 byte expressions. Windows uses the IEEE definition which allows a greater range of exponent (powers of 10) at the expense of accuracy of the mantissa; compared with zOS. However, I would normally expect the difference to surface at the 10th significant digit or lower. You r result suggests to me that the values of y and z are themselves contributing to the problem. And the subtraction of one fraction from another is not helping.
Your criterion is equivalent to
if y ne 0 and z ne 0 and abs(y/z)<0.8;
Try that. Or even
if y ne 0 and z ne 0 and abs(z/y)>1.25;
If neither of these help you are going to have to examine how y and z are calculated or represented. Maybe try y = fuzz(y) and z = fuzz(z) before you do the comparison.
Richard in Oz
12-05-2012 12:06 AM
To take this further please add the following line to your code just after the x=((z-y)/z)*100; line:
Put x y z best32. ;
Then copy the values for the 4 observations that differ from both Windows and mainframe logs.
Richard in Oz
12-05-2012 04:29 AM
I'd still like to see what values of y and z are giving you this trouble in the Windows environment.
Did you try
if y ne 0 and z ne 0 and fuzz(abs(x))>20;
but I suspect fuzz won't help here if you are seeing the value x = 20.0001.
Another suggestion to try (note inverted fraction) :
if y ne 0 and z ne 0 and fuzz(4*abs(z/y))>5;
12-05-2012 04:41 AM
A few things to check:
In general try to reduce the problem to the absolute minimum where it is reproducible. As little data as possible, as little code as possible. Then show us the code and the log.
Hope this helps
02-19-2013 11:45 PM
Thank You all for replying. I found that from sas, that this will be a problem when we migrate from one environment to another.
There is no solution for that.
Yes I have tried using fuzz in different ways.