New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nini1
Obsidian | Level 7

Hello everyone,

 

I have some problem with one variable. Some values are shown with 'e' , with scientific notation. I tried to format with best32. but it does not work. Could you please suggest any solution to this problem?

 

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

As soon as the exponent goes beyond 31, you will get the scientific notation; just run this for illustration:

data test;
format number best32.;
do i = 1 to 33;
  number = 10 ** i;
  output;
end;
run;

You can also see how, from a given exponent, the limits of numeric precision kick in and create artifacts.

View solution in original post

3 REPLIES 3
Amir
PROC Star

Hi,

 

Please provide some sample data and equivalent sample output, as well as the code used to create the output from the input. Please use the formatting tools provided to post code and data.

 

If you are reading from Excel then it is possible the scientific notation is what the raw data looks like.

 

 

Kind regards,

Amir.

Kurt_Bremser
Super User

As soon as the exponent goes beyond 31, you will get the scientific notation; just run this for illustration:

data test;
format number best32.;
do i = 1 to 33;
  number = 10 ** i;
  output;
end;
run;

You can also see how, from a given exponent, the limits of numeric precision kick in and create artifacts.

Nini1
Obsidian | Level 7
Thank you very much!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 10394 views
  • 0 likes
  • 3 in conversation