BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
EMC9
Obsidian | Level 7

Hi Experts

 

Need some help please , I am trying to export numerical data to excel /xslb.

 

I have tried to format the field with BEST/NUMX with no luck.

 

The numerical data is standard 16 digits e.g 1111222233334444.

when I export using the below export code :

 

proc export outfile="Location\&TEST_NO._&TRIM_FROM._to_&TRIM_TO._&NOW..xlsb"
dbms=excelcs data = SDR_TXSET replace;
sheet="DATA";

quit;

 

when I open the excel sheet the data displays like : 1,2226543+13 & when I expand and format the cell the data displays like 

e.g 111122223334440 . which is incorrect.

 

Regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Since precision like that is not needed for statistics (the range of exponents in the real format is sufficient for either very large or very small values), this is usually no problem. Very often such large numbers are identification codes or such, and are therefore stored as character.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

Because of the 8-byte real format that SAS uses for storing numeric data, the precision is limited to ~15 decimal digits. What you see is normal behaviour for data in SAS datasets.

EMC9
Obsidian | Level 7

Thank you for the reply - is there any way around this ? diff method ?

Thanks.

Kurt_Bremser
Super User

Since precision like that is not needed for statistics (the range of exponents in the real format is sufficient for either very large or very small values), this is usually no problem. Very often such large numbers are identification codes or such, and are therefore stored as character.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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