The Basics of SAS Functions

Definition

SAS functions are pre-written routines that perform computations or system manipulations on arguments and return a value. Functions can return either numeric or character results. The value that is returned can be used in an assignment statement or elsewhere in expressions.

Uses of SAS Functions

You can use SAS functions in DATA step programming statements, in WHERE expressions, in macro language statements, in the REPORT procedure, and in Structured Query Language (SQL). They enable you to do the following:
  • calculate sample statistics
  • create SAS date values
  • convert U.S. ZIP codes to state postal codes
  • round values
  • generate random numbers
  • extract a portion of a character value
  • convert data from one data type to another

SAS Functions Categories

SAS functions provide programming shortcuts. The following table shows you all of the SAS function categories. This book covers selected functions that convert data, manipulate SAS date values, and modify values of character variables.
Table 14.1 SAS Function Categories
Functions by Category
Arithmetic
Descriptive Statistics*
Numeric*
State and ZIP code*
Array
Distance
Probability
Trigonometric
Bitwise Logical Operations
External Files
Quantile
Truncation*
CAS
External Routines
Random Number
Variable Control
Character*
Financial
SAS File I/O
Variable Information
Character String Matching
Hyperbolic
Search
Web Services
Combinatorial
Macro
Sort
Web Tools
Date and Time
Mathematical*
Special*
* Denotes the functions that are covered in this chapter.
Last updated: August 23, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.171.253