BookmarkSubscribeRSS Feed
FatCaptain
Fluorite | Level 6

Hi,

I'm trying to optimise some SAS code and part of this involves submitting it to a server which will run it faster.

I'm having an issue though when using proc compare to confirm that I am still getting the same results.

Here's an example from the proc compare output;

obs     set1          set2     difference

19922     -0.0400      -0.0400      6.939E-18

Both of the values appear the same but SAS is saying that there is a minute difference between the two values.

I've looked at the options both locally and on the server and I think that it has something to do with these two variables;

locally;

SYSSIZEOFLONG 4

SYSMAXLONG 2147483647


server;

SYSSIZEOFLONG 8

SYSMAXLONG 9007199254740992



Would anyone be able to tell me if I'm heading in the right direction with this or be able to offer a solution?


Thanks in advance for any help.


4 REPLIES 4
Reeza
Super User

Is that a significant difference to you?

Look at the fuzz option in proc compare.

Tom
Super User Tom
Super User

Looks like the difference is within rounding error.  Things to check are

1) Make sure you are using LENGTH=8 for this variable so that SAS is not truncating the values when it writes it to disk.

2) Are the two systems using the same floating point representation? For example if the remote is an IBM mainframe then it will store floating point numbers differently than a Windows machine.

LinusH
Tourmaline | Level 20

Assuming that the server and the client is different OS and/or bit (32/64), yes, there could be tiny differences.

But print out your difference in decimals:

0.00000000000000006939

I don't know what kind of data you have, but unless you are nuclear scientist or something similar, you could probably live with this difference.

TS-DOC: TS-230 - Dealing with Numeric Representation Error in SAS Applications

http://support.sas.com/techsup/technote/ts654.pdf

http://support.sas.com/resources/papers/proceedings11/275-2011.pdf

Data never sleeps
jakarman
Barite | Level 11

The syssizeoflong is new at 9.3. SAS(R) 9.3 Macro Language: Reference (what is new)

SAS(R) 9.3 Companion for UNIX Environments servers are mostly installed at 64-bit and your desktop still at 32-bit. That is the difference.

Linus has already referred to the floating point details, that is the reason for this normal differences.

Reez has given the Fuzz option with compare als this behavior is known but  should be managed with knowledge on how to.
case solved.....   

---->-- ja karman --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1031 views
  • 0 likes
  • 5 in conversation