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?
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.
Not to SAS.
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.
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 16. Read more here about why you should contribute and what is in it for you!
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.