Random Number Functions and Subroutines

You can call the following Base SAS functions to simulate random values from statistical distributions. However, the SAS/IML language supports the RANDGEN subroutine, which is a more efficient way to generate random values.

The functions that are indicated with an asterisk (*) are deprecated. You should use the RAND function instead.

NORMAL*

returns a random variate from a normal distribution

RANBIN*

returns a random variate from a binomial distribution

RANCAU*

returns a random variate from a Cauchy distribution

RAND

returns a random variate from a specified distribution. (See the RANDGEN subroutine.)

RANEXP*

returns a random variate from an exponential distribution

RANGAM*

returns a random variate from a gamma distribution

RANNOR*

returns a random variate from a normal distribution

RANPOI*

returns a random variate from a Poisson distribution

RANTBL*

returns a random variate from a tabled probability

RANTRI*

returns a random variate from a triangular distribution

RANUNI*

returns a random variate from a uniform distribution

CALL STREAMINIT

specifies a seed value to use for subsequent random number generation by the RAND function. (See the RANDSEED subroutine.)

UNIFORM*

returns a random variate from a uniform distribution