Tips:Generating random number seed from the system clock

From sasCommunity

Jump to: navigation, search

When generating random numbers, it is usually recommended that one save the initial SEED used, in case results need to be replicated. This is not easy when using the system clock to generate the SEED. However, one can create a SEED from the system clock using the same algorithm SAS uses.

SEED = 1e3 * mod(round(1e3 * datetime()), 1e6) + 1;

This SEED can then be saved prior to using it.

Submitted by Daniel Nordlund. Contact me at my Discussion Page.

....read more

Personal tools