Exampler.org SAS PYTHON HTML
SAS Introduction
SAS Abs
SAS Anydigit
SAS ASC
SAS Case Stmnt.
SAS Ceiling
SAS Change type
SAS Char
SAS CMISS
SAS Coalesc
SAS Coalescec
SAS Concatenate
SAS Constant
SAS Create Table
SAS DateTime
SAS Day
SAS Find
SAS Floor
SAS HMS
SAS Holiday
SAS HOUR
SAS Import
SAS Informats
SAS Inobs
SAS Input Stmt.
SAS Int
SAS INTNX
SAS Length
SAS Libname
SAS Loops
SAS Minute
SAS Month
SAS MDY
SAS NMISS
SAS Notdigit
SAS Lowercase
SAS Outobs
SAS Put Stmt.
SAS Rename
SAS Round
SAS Scan
SAS Substr
SAS Sum
SAS STNAME
SAS STNAMEL
SAS Time
SAS Trunc
SAS Uppercase
SAS Week
SAS Year
SAS Financial Functions
SAS Compound

SAS Constant

What is it?

Syntax:

  • Constant('String_Name_of_Constant');

SAS Constant Statement:


 SAS Constant Example:




Data work.my_data_file;

    Result_1 = CONSTANT('E');
    Result_2 = CONSTANT('EULER');
    Result_3 = CONSTANT('PI');
    Result_4 = CONSTANT('GOLDEN');

Run;





What's happening in the script above?

  • The Constant function simply returns one of a variety of constant types.


Constant Example:

Variable Input Output Description
Result_1 E 2.7182818285 The base of a natural logarithm
Result_2 EULER .5772156649 Euler - Mascheroni Constant; At time of writing an Unsolved Problem in math; Presently unknown as to whether the number is irrational or transcendntal.
Result_3 PI 3.1415926536 Ratio of a circles circumference to diameter
Result_4 GOLDEN 0.6180339887 The absolute value of the golden ratio conjugate; which is the conjugate root to the minimal polynomial x2 - x - 1

Connect via LinkedIn

Kevin Regan

Have an article, idea, found a typo, want to contribute? Shoot me an email Here


Below are links to some Udemy Data Science Courses. I've been using Udemy for a number of years now, and I've found their courses super helpful, maybe you will also.