# RANDOM

The RANDOM function produces a number that is randomly distributed between specified low and high boundaries. Randomly generated numbers are useful when building and duplicating tests of applications. They are especially useful for simulation and forecasting applications.

Tip:

To compute the number, RANDOM uses the values of the RANDOM.SEED.1 and RANDOM.SEED.2 options and then changes the values for the next time. When you create your own seeds, set the value of both options to odd numbers. This practice enhances the randomness of the numbers that are produced.

Return Value

DECIMAL

Syntax

RANDOM([lowbound] [highbound])

Parameters

lowbound

A numeric expression that specifies the lower boundary for the random number series. The default is `0`. When lowbound is `NA`, the RANDOM function produces `NA`.

highbound

A numeric expression that specifies the upper boundary for the random number series. The default is `1`. When highbound is `NA`, the RANDOM function produces `NA`

Examples

Example 8-64 Producing Random Numbers

This example assigns random numbers between 100 and 200 to a variable called `test`, which is dimensioned by `product`.

```test = RANDOM(100 200)
REPORT test
```

These statements produce a report such as the following.

```PRODUCT           TEST
-------------- ----------
Tents              122.93
Canoes             176.69
Racquets           168.32
Sportswear         150.92
Footwear           187.46
```
{"ft_lang_label":"__label__en","ft_lang_prob":0.7547402,"math_prob":0.9695669,"size":1413,"snap":"2020-34-2020-40","text_gpt3_token_len":320,"char_repetition_ratio":0.1376863,"word_repetition_ratio":0.10138249,"special_character_ratio":0.2462845,"punctuation_ratio":0.115079366,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9629041,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-27T05:00:19Z\",\"WARC-Record-ID\":\"<urn:uuid:a3b99afc-2a14-4d43-9f41-01da6d3e01c4>\",\"Content-Length\":\"10953\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9f776b4d-0c51-4d38-b59a-bb7655259799>\",\"WARC-Concurrent-To\":\"<urn:uuid:f6cfb0ff-c352-4283-8128-04f00aa17044>\",\"WARC-IP-Address\":\"184.25.199.158\",\"WARC-Target-URI\":\"https://docs.oracle.com/cd/E18283_01/olap.112/e17122/dml_functions_2062.htm\",\"WARC-Payload-Digest\":\"sha1:DP56ZBIIJSIX4MLMU35IDO2FRQR32KH6\",\"WARC-Block-Digest\":\"sha1:AM6Q7MAO7LQNKDZTQYKANZ62PHQXFF4M\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400250241.72_warc_CC-MAIN-20200927023329-20200927053329-00186.warc.gz\"}"}