RANDOM macro
The RANDOM macro is available only in IBM® Campaign.
Syntax
RANDOM(num [, seed]) RANDOM(num, value1, value2 [, seed])
Parameters
num
The number of random numbers to generate. This value must be a positive integer greater than zero.
value1
A bound on the random numbers to generate. This can be any constant value or an expression evaluating to a constant. If this parameter is not provided, the default is zero.
value2
The other bound on the random numbers to generate. This can be any constant value or an expression evaluating to a constant. If this parameter is not provided, the default is one.
seed
An optional seed to use for random number generation. This must be an integer.
Description
RANDOM generates a column of random numbers. It returns one new column containing num random numbers. If value1 and value2 are specified, the random numbers will be generated between (and including) those bounds. If they are not specified, the default is to generate values between zero and one. If seed is provided, it will be used as a seed to the random number generator.
*
If seed is greater than or equal to , the value is replaced with 2 32- 1. Values of seed above will be rounded (that is, precision is lost). Therefore, multiple values may result in the same value of seed.
Examples
Creates one new column named TEMP containing random numbers of unlimited length.
Creates one new column named TEMP containing 100 random numbers between 0.0 and 1.0.
Creates one new column named TEMP containing 100 random generated from the seed number 5943049.
Creates one new column named TEMP containing 100 random numbers between 0 and 100.0.
Creates one new column named TEMP containing 100 random numbers between -0 and 100 generated from the seed number 5943049.
Related Functions