Results can also vary when you access data that is stored
on one system by using a client on a different system. This example
illustrates running a DATA step from a Windows client to access SAS
data in the
z/OS environment.
data z(keep=x);
x=5.2;
output;
y=1000;
x=(x+y)-y; /*almost 5.2 */
output;
run;
proc print data=z;
run;
Here is the output this
DATA step produces.
The next example illustrates
the output that you receive when you execute the DATA step interactively
under Windows or under
z/OS.
data z1;
set z(where=(x=5.2));
run;
Here is the corresponding
z/OS output.
NOTE: There were 1 observations read from the data set WORK.Z.
WHERE x=5.2;
NOTE: The data set WORK.Z1 has 1 observations and 1 variables.
The DATA statement used 0.00 CPU seconds and 14476K.
In the above example,
the expected count was not returned correctly under
z/OS because the
imperfection of the data and finite precision are not taken into account.
You cannot use equality to obtain a correct count because it does
not include the “almost 5.2” cases in that count. To
obtain the correct results under
z/OS, you must run this DATA step:
data z1;
set z(where=(compfuzz(x,5.2,1e-10)=0));
run;
Here is the
z/OS output
from this DATA step.
NOTE: There were 2 observations read from the data set WORK.Z.
WHERE COMPFUZZ(x, 5.2, 1E-10)=0;
NOTE: The data set WORK.Z1 has 2 observations and 1 variables.