Contributor
Posts: 62

# Migration: Mainframe to Windows.

Hi

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);

format .....

x commax8.1;   /*here x is user defined variable which is used for calculations.*/

.........

.........

if  y ne 0 then do;

x=((z-y)/z)*100;

.......

......

if y ne 0 and z ne 0 and abs(x)>20;

run;

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...

Thank You

Super Contributor
Posts: 644

## Re: Migration: Mainframe to Windows.

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.

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

Contributor
Posts: 62

## Re: Migration: Mainframe to Windows.

Thank you richard

I have tried these functions but still unable to solve the issue.

Super Contributor
Posts: 644

## Re: Migration: Mainframe to Windows.

Imroze

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

Contributor
Posts: 62

## Re: Migration: Mainframe to Windows.

Hi Richard

Super Contributor
Posts: 644

## Re: Migration: Mainframe to Windows.

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;

Richard

Frequent Contributor
Posts: 106

## Re: Migration: Mainframe to Windows.

A few things to check:

• You say there are 1019 rows on the mainframe, 1023 on windows.
Where do you get this information from? Is it from the NOTE: at the end of the datastep?
If yes, then it should also give you some information about the minimum and maximum record lengths of the input file.
Are there some extremely short records?
• Please show us the INPUT statement. Reason: if it is a simple input statement then it should have no bearing on the number of records read.
• Please show us the INFILE statement and better yet the NOTE that SAS spits out at the end of the datastep giving us detailed information about the file just read. Remember there may be different INFILE option defaults between mainframe and windows.

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

Robert

Contributor
Posts: 62

## Re: Migration: Mainframe to Windows.

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.

Thanks Again

Discussion stats
• 7 replies
• 598 views
• 0 likes
• 3 in conversation