Absolute value of column in SAS – ABS() function

Absolute value of the column in SAS is calculated using ABS() Function in SAS. ABS() Function in SAS takes column as argument and calculates absolute value of the column.

SYNTAX – ABS() function

ABS(column)

Absolute value of column in SAS - ABS() function 2

 

The following statements illustrate the ABS() Function:

So we will be using STATE_SCORE Table in our example
Absolute value of column in SAS - ABS() function 1

 

 

 

Absolute Value of column in SAS – ABS()

ABS() Function in SAS takes column as argument and converts column to Absolute value.


data STATE_SCORE; 
set STATE_SCORE; 
absolute_score = ABS(Hindex_score); 
run; 

So the resultant table with absolute value of the column calculated will be

Absolute value of column in SAS - ABS() function 2

 

                                                                                                 

 

Author

  • Sridhar Venkatachalam

    With close to 10 years on Experience in data science and machine learning Have extensively worked on programming languages like R, Python (Pandas), SAS, Pyspark.

    View all posts