PRDNOR and PRDUNI: Generating Reproducible Random Numbers

How to:

The PRDNOR and PRDUNI functions generate reproducible random numbers:

  • PRDNOR generates reproducible double-precision random numbers normally distributed with an arithmetic mean of 0 and a standard deviation of 1.
  • PRDUNI generates reproducible 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 Reproducible Random Numbers

{PRDNOR|PRDUNI}(seed, output)

where:

PRDNOR

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

PRDUNI

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

seed

Numeric

Is the seed or the field that contains the seed, up to 9 digits. The seed is truncated to an integer.

output

Double-precision

Example: Generating Reproducible Random Numbers

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

PRDNOR(40, 'D12.2')

WebFOCUS

Feedback