RDNORM and RDUNIF: Generating Random Numbers

How to:

The RDNORM and RDUNIF functions generate random numbers:

  • RDNORM generates double-precision random numbers normally distributed with an arithmetic mean of 0 and a standard deviation of 1.
  • RDUNIF generates double-precision random numbers uniformly distributed between 0 and 1 (that is, any random number it generates has an equal probability of being anywhere between 0 and 1).

Syntax: How to Generate Random Numbers

{RDNORM|RDUNIF}(output)

where:

RDNORM

Generates double-precision random numbers normally distributed with an arithmetic mean of 0 and a standard deviation of 1.

RDUNIF

Generates double-precision random numbers uniformly distributed between 0 and 1.

output

Double-precision

Example: Generating Random Numbers

RDNORM assigns random numbers and stores them in a column with the format D12.2.

RDNORM('D12.2')

WebFOCUS

Feedback