BookmarkSubscribeRSS Feed
SASGeek
Obsidian | Level 7

Hello,

My company uses SAS EG on a grid but to get the results  to Excel we need to copy down to a linux site and use a transfer program to get it into excel. Nice for larger reports but for smaller, it's a pain. I use copy/paste but the result in Excel is 9.9E+27 instead of 000000000000990000000012345678900837

 

In my other company I was able to take a result from EG, and export to Excel directly. Prior to that I had just the SAS PC interface and all was fine. Not in this case. I asked and this company does not have SAS PC (or at least distribute anything other than EG).

 

Any suggestions are appreciated.

 

Thanks!!

 

Paula

2 REPLIES 2
ballardw
Super User

This is not a SAS issue. It is an Excel / spreadsheet software issue. The program is trying to be helpful by displaying the value in the assigned with of a cell. If the value is too large and can be interpreted as numeric (i.e. digits and decimal perhaps) then the program will try to show something that fits. So it will revert to scientific notation. SAS does something similar when you use a BEST format that is too small to nicely display the whole value.


Additionally SAS won't even display that many leading zeroes for a number value unless you are using a very wide Z format. So if you get that result you may have sent a character value to Excel that is CHANGING the underlying value to numeric. So you may to provide actual example data values and exactly how you are sending the data to Excel. It may mean that you need to provide better definitions to the process to get Excel to cooperate, possibly involving TAGATTR options to provide attribute instructions for Excel to read.

 

 

An example. The programmer tells SAS to display the value of X in 5 columns but the value won't display as an integer in 5 characters so SAS uses exponential notation.

29   data example;
30      x=123456789;
31      put x=best5.;
32   run;

x=123E6

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 462 views
  • 0 likes
  • 3 in conversation