SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
whymath
Lapis Lazuli | Level 10
data _null_;
  x=0.123456789d2;
  y=0.123456789e2;
  z=x=y;
  put x= /y= /z=;
run;

x=12.3456789
y=12.3456789
z=1

I can use D or E in scientific notation in SAS, is there any difference between them?

1 ACCEPTED SOLUTION

Accepted Solutions
s_lassen
Meteorite | Level 14

I think the D notation comes from FORTRAN, where it is used to denote double-precision numbers (64-bit floating-point numbers, as opposed to 32 bit - like a C double vs. float). In SAS, all numbers are double-precision floats, so it does not matter here. But I would recommend using the E notation, as that is more commonly understood.

View solution in original post

2 REPLIES 2
s_lassen
Meteorite | Level 14

I think the D notation comes from FORTRAN, where it is used to denote double-precision numbers (64-bit floating-point numbers, as opposed to 32 bit - like a C double vs. float). In SAS, all numbers are double-precision floats, so it does not matter here. But I would recommend using the E notation, as that is more commonly understood.

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 806 views
  • 3 likes
  • 3 in conversation