Sample 26169: Use SAS to return the value of pi
Prior to Version 7 of SAS, the function ARCOS was used to return pi. The CONSTANT function can now be used to return the value of pi and other mathematical constants.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
data _null_;
pi=constant('pi');
put pi=;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The log shows the result
19 data _null_;
20 pi=constant('pi');
21 put pi=;
22 run;
pi=3.1415926536
Use the function CONSTANT to return the value of pi and other mathematical constants.
Type: | Sample |
Topic: | SAS Reference ==> DATA Step SAS Reference ==> Functions ==> Mathematical
|
Date Modified: | 2007-11-27 13:31:20 |
Date Created: | 2007-06-28 13:05:39 |
Operating System and Release Information
SAS System | Base SAS | All | n/a | n/a |